我在
http://code.google.com/p/aima-java/
我尝试了以下代码来使用 dpllsolver 解决表达式
输入是
(A <=> B) AND (C => D) AND (A AND C) AND (NOT (B AND D)) AND (NOT (B AND D AND E))
CNF 变压器将其转换为
( ( ( NOT A ) OR B ) AND ( ( NOT B ) OR A ) )
它不考虑逻辑的其他部分,只考虑第一项,如何使其正常工作?
如果其他卫星求解器可以做到,请建议我
PEParser parser = new PEParser();
CNFTransformer transformer=new CNFTransformer();
Sentence and;
Sentence transformedAnd;
DPLL dpll = new DPLL();
Sentence sentence = (Sentence) parser.parse("(A <=> B) AND (C => D) AND (A AND C) AND (NOT (B AND D)) AND (NOT (B AND D AND E))");
transformedAnd = transformer.transform(sentence);
System.out.println(transformedAnd.toString());
boolean satisfiable = dpll.dpllSatisfiable(transformedAnd);
System.out.println(satisfiable);