使用 DPLL sat 求解器求解

发布于 2024-09-28 15:37:36 字数 972 浏览 12 评论 0原文

中找到了一个卫星求解器

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤檠 2024-10-05 15:37:36

尝试一下这个: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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文