techniques.solvers
Class DPLL
java.lang.Object
|
+--techniques.solvers.DPLL
- public class DPLL
- extends java.lang.Object
Field Summary |
static int |
count
|
Constructor Summary |
DPLL()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
count
public static int count
DPLL
public DPLL()
solve
public static Interpretation solve(Conjunction s)
- Assumes sentence 's' has been parsed by CNF.parse()
i.e., 's' should be a CNF sentence.
solve_internal
public static Interpretation solve_internal(Conjunction cnfsentence,
Interpretation interpretation)
findUnitClause
public static Sentence findUnitClause(Conjunction s)
findPureLiteral
public static Sentence findPureLiteral(Conjunction s)
- go through each clause in the sentence.
go through each element in each clause.
if the element is a positive literal, mark it as such if unmarked;
if it has been marked as negated, remove it from the list.
if the element is a negated literal, mark it as such if unmarked;
if it has been marked as positive, remove it from the list.
if nothing in the list after looping through all clauses, return null.
else, return the first element in the list.
chooseVariable
public static Variable chooseVariable(Sentence s)
- get a list of the variables in s and somehow pick one of them
simplify
public static Conjunction simplify(Conjunction s,
Variable v,
Interpretation i)
- given an assignment to the proposition v,
figure out which clauses in the cnf sentence 's' can be simplfied
getFirstVariable
public static Variable getFirstVariable(Sentence n)
getFirstVariable
public static Variable getFirstVariable(java.util.HashMap h)
isEmptySentence
public static boolean isEmptySentence(Sentence s)
supplyMissingValues
public static Interpretation supplyMissingValues(Interpretation i,
java.util.Set props)