Package org.mcp.sat
Class SATDomain<T>
java.lang.Object
org.mcp.sat.SATDomain<T>
SATDomain wraps a SATInteger around a finite collection of values and provides an API
for working directly with those values in SAT-based symbolic computations.
Supports encoding, decoding, and value lookup for SAT-based domains.
- Since:
- 2025-02-28
- Author:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks equality with another object.Returns the underlying MutableSATInteger.inthashCode()Returns the hash code for this SATDomain.static intnumBits(int size) Returns the number of bits used to represent a domain of the given size.satAssignmentToValue(org.logicng.formulas.Formula satAssignment) Decodes a SAT assignment to the corresponding value in the domain.voidSets the underlying MutableSATInteger.org.logicng.formulas.FormulaReturns a formula representing the assignment of the given value.
-
Constructor Details
-
SATDomain
Constructs a SATDomain from a formula factory, value list, and bit index offset.- Parameters:
factory- the formula factoryvalues- the list of values in the domainindex- the starting bit index
-
SATDomain
Copy constructor.- Parameters:
other- the SATDomain to copy
-
-
Method Details
-
numBits
public static int numBits(int size) Returns the number of bits used to represent a domain of the given size.- Parameters:
size- the number of elements in the domain- Returns:
- the number of bits required
-
value
Returns a formula representing the assignment of the given value.- Parameters:
value- the value to encode- Returns:
- the formula representing the value
-
satAssignmentToValue
Decodes a SAT assignment to the corresponding value in the domain.- Parameters:
satAssignment- the SAT assignment formula- Returns:
- the value corresponding to the assignment
-
getInteger
Returns the underlying MutableSATInteger.- Returns:
- the MutableSATInteger
-
setInteger
Sets the underlying MutableSATInteger.- Parameters:
i- the MutableSATInteger to set
-
equals
Checks equality with another object. -
hashCode
public int hashCode()Returns the hash code for this SATDomain.
-