使用DPLL坐标求解器求解

kar*_*thi 4 java logic artificial-intelligence sat-solvers first-order-logic

我找到了一个坐着的求解器

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))
Run Code Online (Sandbox Code Playgroud)

CNF变压器将其转换为

 (  (  ( NOT A )  OR B ) AND  (  ( NOT B )  OR A ) )
Run Code Online (Sandbox Code Playgroud)

它不考虑逻辑的其他部分,它只考虑第一个术语,如何使其正常工作?

请建议我,如果其他一些坐着的解决方案可以做到这一点

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);
Run Code Online (Sandbox Code Playgroud)

小智 5

试试这个:http://www.sat4j.org/

我相信这项技术已被整合到Eclipse Provisioning System P2中以解决插件依赖性问题.http://blog.mancoosi.org/index.php/2008/06/01/4-edos-offspring-1-eclipse-p2-will-include-sat-solver-technology-for-managing-plugins