使用 DPLL sat 求解器求解
中找到了一个卫星求解器
我在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);
I found a sat solver in
http://code.google.com/p/aima-java/
I tried the following code to solve an expression using dpllsolver
the input is
(A <=> B) AND (C => D) AND (A AND C) AND (NOT (B AND D)) AND (NOT (B AND D AND E))
CNF transformer transforms it to
( ( ( NOT A ) OR B ) AND ( ( NOT B ) OR A ) )
it doesn't consider the other parts of the logic, it considers only first term, how to make it work correctly?
please suggest me if some other sat solver can do it
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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试一下这个:http://www.sat4j.org/
我相信这项技术已被纳入Eclipse Provisioning System P2 来解决插件依赖性。
Try this one out: http://www.sat4j.org/
I believe that this technology has been incorporated into the Eclipse Provisioning System P2 to solve plugin dependencies. http://blog.mancoosi.org/index.php/2008/06/01/4-edos-offspring-1-eclipse-p2-will-include-sat-solver-technology-for-managing-plugins