Class Formula<T>
A Boolean Formula. Consists of a set of Clause<T>s which all must be true.
Assembly: NanoByte.SatSolver.dll
public class Formula<T> : HashSet<Clause<T>> where T : IEquatable<T>
Type Parameters
Name |
Description |
T |
The underlying type used to identify/compare Literals.
|
Constructors
Creates an empty Formula.
Declaration
Creates a Formula consisting the specified clauses
.
Declaration
public Formula(IEnumerable<Clause<T>> clauses)
Parameters
Properties
Indicates whether this Formula contains any empty Clauses and is therefore unsatisfiable.
Declaration
public bool ContainsEmptyClause { get; }
Property Value
Indicates whether this Formula is a consistent set of Literals, i.e. consists only non-conflicting Unit Clauses.
Declaration
public bool IsConsistent { get; }
Property Value
Methods
Declaration
public bool Equals(Formula<T> other)
Parameters
Type |
Name |
Description |
Formula<T> |
other |
|
Returns
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Declaration
public override int GetHashCode()
Returns
Returns a set of all Literal<T>s referenced in the Formula.
Declaration
public IEnumerable<Literal<T>> GetLiterals()
Returns
Returns a set of all Literal<T>s referenced in the Formula that are pure, i.e. do not occur both negated and non-negated.
Declaration
public IEnumerable<Literal<T>> GetPureLiterals()
Returns
Returns a simplified copy of the Formula. This applies Unit propagation and Pure Literal elimination.
Declaration
public Formula<T> Simplify()
Returns
Declaration
public override string ToString()
Returns
Operators
Creates a Formula<T> consisting of all Clauses from an existing Formula plus an additional Clause<T>.
Declaration
public static Formula<T> operator &(Clause<T> clause, Formula<T> formula)
Parameters
Type |
Name |
Description |
Clause<T> |
clause |
The additional Clause.
|
Formula<T> |
formula |
The existing Formula.
|
Returns
Creates a Formula<T> consisting of all Clauses from an existing Formula plus an additional Clause<T>.
Declaration
public static Formula<T> operator &(Formula<T> formula, Clause<T> clause)
Parameters
Type |
Name |
Description |
Formula<T> |
formula |
The existing Formula.
|
Clause<T> |
clause |
The additional Clause.
|
Returns
Implements