trait Solver extends CNF
- Alphabetic
- By Inheritance
- Solver
- CNF
- PropositionalLogic
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
-
trait
AbsVar
extends AnyRef
- Definition Classes
- PropositionalLogic
-
final
case class
And
(ops: Set[Prop]) extends Prop with Product with Serializable
- Definition Classes
- PropositionalLogic
-
final
case class
AtMostOne
(ops: List[Sym]) extends Prop with Product with Serializable
- Definition Classes
- PropositionalLogic
-
final
case class
Eq
(p: Var, q: Const) extends Prop with Product with Serializable
- Definition Classes
- PropositionalLogic
-
final
case class
Not
(a: Prop) extends Prop with Product with Serializable
- Definition Classes
- PropositionalLogic
-
final
case class
Or
(ops: Set[Prop]) extends Prop with Product with Serializable
- Definition Classes
- PropositionalLogic
-
class
Prop
extends AnyRef
- Definition Classes
- PropositionalLogic
-
trait
PropMap
extends AnyRef
- Definition Classes
- PropositionalLogic
-
trait
PropTraverser
extends AnyRef
- Definition Classes
- PropositionalLogic
-
final
case class
Solution
(model: Model, unassigned: List[Sym]) extends Product with Serializable
- Definition Classes
- PropositionalLogic
-
final
class
Sym
extends Prop
- Definition Classes
- PropositionalLogic
-
trait
TypeConstExtractor
extends AnyRef
- Definition Classes
- PropositionalLogic
-
trait
ValueConstExtractor
extends AnyRef
- Definition Classes
- PropositionalLogic
-
trait
VarExtractor
extends AnyRef
- Definition Classes
- PropositionalLogic
-
class
AlreadyInCNF
extends AnyRef
- Definition Classes
- CNF
-
trait
CnfBuilder
extends AnyRef
- Definition Classes
- CNF
-
final
case class
Solvable
(cnf: Cnf, symbolMapping: SymbolMapping) extends Product with Serializable
- Definition Classes
- CNF
-
class
SymbolMapping
extends AnyRef
- Definition Classes
- CNF
-
class
TransformToCnf
extends CnfBuilder
Plaisted transformation: used for conversion of a propositional formula into conjunctive normal form (CNF) (input format for SAT solver).
Plaisted transformation: used for conversion of a propositional formula into conjunctive normal form (CNF) (input format for SAT solver). A simple conversion into CNF via Shannon expansion would also be possible but it's worst-case complexity is exponential (in the number of variables) and thus even simple problems could become untractable. The Plaisted transformation results in an _equisatisfiable_ CNF-formula (it generates auxiliary variables) but runs with linear complexity. The common known Tseitin transformation uses bi-implication, whereas the Plaisted transformation uses implication only, thus the resulting CNF formula has (on average) only half of the clauses of a Tseitin transformation. The Plaisted transformation uses the polarities of sub-expressions to figure out which part of the bi-implication can be omitted. However, if all sub-expressions have positive polarity (e.g., after transformation into negation normal form) then the conversion is rather simple and the pseudo-normalization via NNF increases chances only one side of the bi-implication is needed.
- Definition Classes
- CNF
-
type
Clause = Set[Lit]
- Definition Classes
- CNF
-
type
Cnf = Array[Clause]
Conjunctive normal form (of a Boolean formula).
Conjunctive normal form (of a Boolean formula). A formula in this form is amenable to a SAT solver (i.e., solver that decides satisfiability of a formula).
- Definition Classes
- CNF
-
abstract
type
Const
- Definition Classes
- PropositionalLogic
-
type
Model = Map[Sym, Boolean]
- Definition Classes
- PropositionalLogic
-
abstract
type
Tree
- Definition Classes
- PropositionalLogic
- type TseitinModel = Set[Lit]
-
abstract
type
Type
- Definition Classes
- PropositionalLogic
-
abstract
type
TypeConst <: Const
- Definition Classes
- PropositionalLogic
-
abstract
type
ValueConst <: Const
- Definition Classes
- PropositionalLogic
-
abstract
type
Var <: AbsVar
- Definition Classes
- PropositionalLogic
Abstract Value Members
-
abstract
val
NullConst: Const
- Definition Classes
- PropositionalLogic
-
abstract
def
TypeConst: TypeConstExtractor
- Definition Classes
- PropositionalLogic
-
abstract
def
ValueConst: ValueConstExtractor
- Definition Classes
- PropositionalLogic
-
abstract
val
Var: VarExtractor
- Definition Classes
- PropositionalLogic
-
abstract
def
prepareNewAnalysis(): Unit
- Definition Classes
- PropositionalLogic
-
abstract
def
reportWarning(message: String): Unit
- Definition Classes
- PropositionalLogic
-
abstract
def
uncheckedWarning(pos: Position, msg: String): Unit
- Definition Classes
- PropositionalLogic
Concrete Value Members
-
object
AnalysisBudget
- Definition Classes
- PropositionalLogic
-
object
And
extends Serializable
- Definition Classes
- PropositionalLogic
-
object
False
extends Prop with Product with Serializable
- Definition Classes
- PropositionalLogic
-
object
Or
extends Serializable
- Definition Classes
- PropositionalLogic
-
object
Sym
- Definition Classes
- PropositionalLogic
-
object
True
extends Prop with Product with Serializable
- Definition Classes
- PropositionalLogic
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Solver, B)
-
def
/\(props: Iterable[Prop]): Product with Serializable with Prop
- Definition Classes
- PropositionalLogic
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
EmptyModel: Map[Sym, Boolean]
- Definition Classes
- Solver → PropositionalLogic
- val EmptyTseitinModel: Set[Lit]
-
val
NoModel: Model
- Definition Classes
- Solver → PropositionalLogic
- val NoTseitinModel: TseitinModel
-
def
\/(props: Iterable[Prop]): Product with Serializable with Prop
- Definition Classes
- PropositionalLogic
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
budgetProp: sys.Prop[String]
- Definition Classes
- PropositionalLogic
-
def
clause(l: Lit*): Clause
- Definition Classes
- CNF
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def cnfString(f: Array[Clause]): String
- def ensuring(cond: (Solver) ⇒ Boolean, msg: ⇒ Any): Solver
- def ensuring(cond: (Solver) ⇒ Boolean): Solver
- def ensuring(cond: Boolean, msg: ⇒ Any): Solver
- def ensuring(cond: Boolean): Solver
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
eqFreePropToSolvable(p: Prop): Solvable
- Definition Classes
- CNF → PropositionalLogic
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
findAllModelsFor(solvable: Solvable, pos: Position): List[Solution]
- Definition Classes
- Solver → PropositionalLogic
-
def
findModelFor(solvable: Solvable): Model
- Definition Classes
- Solver → PropositionalLogic
- def findTseitinModelFor(clauses: Array[Clause]): TseitinModel
- def formatted(fmtstr: String): String
-
def
gatherSymbols(p: Prop): Set[Sym]
- Definition Classes
- PropositionalLogic
-
def
gatherVariables(p: Prop): Set[Var]
- Definition Classes
- PropositionalLogic
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
propToSolvable(p: Prop): Solvable
- Definition Classes
- PropositionalLogic
-
def
removeVarEq(props: List[Prop], modelNull: Boolean = false): (Prop, List[Prop])
- Definition Classes
- PropositionalLogic
-
def
simplify(f: Prop): Prop
Simplifies propositional formula according to the following rules: - eliminate double negation (avoids unnecessary Tseitin variables) - flatten trees of same connectives (avoids unnecessary Tseitin variables) - removes constants and connectives that are in fact constant because of their operands - eliminates duplicate operands - convert formula into NNF: all sub-expressions have a positive polarity which makes them amenable for the subsequent Plaisted transformation and increases chances to figure out that the formula is already in CNF
Simplifies propositional formula according to the following rules: - eliminate double negation (avoids unnecessary Tseitin variables) - flatten trees of same connectives (avoids unnecessary Tseitin variables) - removes constants and connectives that are in fact constant because of their operands - eliminates duplicate operands - convert formula into NNF: all sub-expressions have a positive polarity which makes them amenable for the subsequent Plaisted transformation and increases chances to figure out that the formula is already in CNF
Complexity: DFS over formula tree
See http://www.decision-procedures.org/slides/propositional_logic-2x3.pdf
- Definition Classes
- PropositionalLogic
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def →[B](y: B): (Solver, B)
The Scala compiler API.
The following resources are useful for Scala plugin/compiler development: