|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sat4j.tools.SolverDecorator<ISolver> org.sat4j.tools.GateTranslator
public class GateTranslator
Utility class to easily feed a SAT solver using logical gates.
Constructor Summary | |
---|---|
GateTranslator(ISolver solver)
|
Method Summary | |
---|---|
void |
additionalFullAdderConstraints(int xcarry,
int xsum,
int a,
int b,
int c)
|
IConstr[] |
and(int y,
int x1,
int x2)
Translate y <=> x1 /\ x2 |
IConstr[] |
and(int y,
IVecInt literals)
Translate y <=> x1 /\ x2 /\ ... /\ xn into clauses. |
void |
fullAdderCarry(int x,
int a,
int b,
int c)
|
void |
fullAdderSum(int x,
int a,
int b,
int c)
|
IConstr |
gateFalse(int y)
translate y <=> FALSE into a clause. |
IConstr |
gateTrue(int y)
translate y <=> TRUE into a clause. |
void |
halfAdderCarry(int x,
int a,
int b)
|
void |
halfAdderSum(int x,
int a,
int b)
|
IConstr[] |
iff(int y,
IVecInt literals)
translate y <=> (x1 <=> x2 <=> ... <=> xn) into clauses. |
IConstr[] |
ite(int y,
int x1,
int x2,
int x3)
translate y <=> if x1 then x2 else x3 into clauses. |
IConstr[] |
not(int y,
int x)
Translate y <=> not x into clauses. |
void |
optimisationFunction(IVecInt literals,
IVec<BigInteger> coefs,
IVecInt result)
Translate an optimization function into constraints and provides the binary literals in results. |
IConstr[] |
or(int y,
IVecInt literals)
translate y <=> x1 \/ x2 \/ ... \/ xn into clauses. |
void |
xor(int x,
int a,
int b)
|
IConstr[] |
xor(int y,
IVecInt literals)
translate y <=> x1 xor x2 xor ... xor xn into clauses. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GateTranslator(ISolver solver)
Method Detail |
---|
public IConstr gateFalse(int y) throws ContradictionException
y
- a variable to falsify
ContradictionException
- iff a trivial inconsistency is found.public IConstr gateTrue(int y) throws ContradictionException
y
- a variable to verify
ContradictionException
public IConstr[] ite(int y, int x1, int x2, int x3) throws ContradictionException
y
- x1
- the selector variablex2
- x3
-
ContradictionException
public IConstr[] and(int y, IVecInt literals) throws ContradictionException
y
- literals
- the x1 ... xn literals.
ContradictionException
public IConstr[] and(int y, int x1, int x2) throws ContradictionException
y
- x1
- x2
-
ContradictionException
public IConstr[] or(int y, IVecInt literals) throws ContradictionException
y
- literals
-
ContradictionException
public IConstr[] not(int y, int x) throws ContradictionException
y
- x
-
ContradictionException
public IConstr[] xor(int y, IVecInt literals) throws ContradictionException
y
- literals
-
ContradictionException
public IConstr[] iff(int y, IVecInt literals) throws ContradictionException
y
- literals
-
ContradictionException
public void xor(int x, int a, int b) throws ContradictionException
ContradictionException
public void fullAdderSum(int x, int a, int b, int c) throws ContradictionException
ContradictionException
public void fullAdderCarry(int x, int a, int b, int c) throws ContradictionException
ContradictionException
public void additionalFullAdderConstraints(int xcarry, int xsum, int a, int b, int c) throws ContradictionException
ContradictionException
public void halfAdderSum(int x, int a, int b) throws ContradictionException
ContradictionException
public void halfAdderCarry(int x, int a, int b) throws ContradictionException
ContradictionException
public void optimisationFunction(IVecInt literals, IVec<BigInteger> coefs, IVecInt result) throws ContradictionException
ContradictionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |