Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppliedConstraint ¶
type AppliedConstraint struct { Variable Variable Constraint Constraint }
AppliedConstraint values compose a single Constraint with the Variable it applies to.
func (AppliedConstraint) String ¶
func (a AppliedConstraint) String() string
String implements fmt.Stringer and returns a human-readable message representing the receiver.
type Constraint ¶
type Constraint interface { String(subject Identifier) string Apply(lm LitMapping, subject Identifier) z.Lit Order() []Identifier Anchor() bool }
Constraint implementations limit the circumstances under which a particular Variable can appear in a solution.
type Identifier ¶
type Identifier string
Identifier values uniquely identify particular Variables within the input to a single call to Solve.
func IdentifierFromString ¶
func IdentifierFromString(s string) Identifier
IdentifierFromString returns an Identifier based on a provided string.
func (Identifier) String ¶
func (id Identifier) String() string
type LitMapping ¶
type LitMapping interface { LitOf(subject Identifier) z.Lit LogicCircuit() *logic.C }
LitMapping performs translation between the input and output types of Solve (Constraints, Variables, etc.) and the variables that appear in the SAT formula.
type NotSatisfiable ¶
type NotSatisfiable []AppliedConstraint
NotSatisfiable is an error composed of a minimal set of applied constraints that is sufficient to make a solution impossible.
func (NotSatisfiable) Error ¶
func (e NotSatisfiable) Error() string
type SearchPosition ¶
type SearchPosition interface { Variables() []Variable Conflicts() []AppliedConstraint }
type Tracer ¶
type Tracer interface {
Trace(p SearchPosition)
}
type Variable ¶
type Variable interface { // Identifier returns the Identifier that uniquely identifies // this Variable among all other Variables in a given // problem. Identifier() Identifier // Constraints returns the set of constraints that apply to // this Variable. Constraints() []Constraint }
Variable values are the basic unit of problems and solutions understood by this package.
Directories ¶
Path | Synopsis |
---|---|
Package solver implements a general-purpose solver for boolean constraint satisfiability problems.
|
Package solver implements a general-purpose solver for boolean constraint satisfiability problems. |