永发信息网

Implement a SAT solver from scratch.

答案:2  悬赏:40  手机版
解决时间 2021-02-20 01:00
Implement a SAT solver from scratch.
最佳答案
Implement a SAT solver from scratch. (See Russell and Norvig, Ch. 7 for
details on the SAT problem.) Your solver should read a satis ability problem
in conjunctive normal form, in DIMACS format (see below), from standard
input. The output should be A satis ying variable assignment, if one exists; or
UNSATISFIABLE, if there is no solution.
Your code does not need to be heavily optimized but should be able to solve
problems with hundreds of clauses and up 20 variables in at most a few seconds.
(State of the art solvers can handle problems with millions of clauses and tens
of thousands of variables.)
DIMACS CNF format is widely accepted as the standard format for boolean
formulas in CNF. Benchmarks listed on satlib.org, for instance, are in the DI-
MACS CNF format. An input le starts with comments (each line starts with
c). The number of variables and the number of clauses is de ned by the line p
cnf variables clauses Each of the next lines speci es a clause: a positive literal
is denoted by the corresponding number, and a negative literal is denoted by
the corresponding negative number. The last number in a line should be zero.
Example 1: (x1 _ x2) ^ (:x1 _ :x2)
Input:
c example1.cnf
p cnf 2 2
1 2 0
-1 -2 0
Output:
1 -2
Example 2: (x1 _ x2) ^ :x1 ^ :x2
Input:
c example2.cnf
p cnf 2 3
1 2 0
-1 0
-2 0
Output:
UNSATISFIABLE
全部回答
不知
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
美味坊原味汤粉王我想知道这个在什么地方
夜盲症可能是由于缺乏
传奇SF双挂怎么调达到速度快喝药快?
属马人明日运势
【说分手之后】...而不是伤心呢?为什么。。别
红烧肉怎样让它酥烂
dnf 狂战士用梁月的钝剑好还是阳剑
空姐可以打耳洞,染发吗
还有5个月就开始研究生考试了,怎么安排时间
三星手机是不是最好的手机
HP LaserJet M5035有没有win7 64位的驱动
电脑开机进去欢迎使用界面就蓝屏了 必须重启
下列药物中不属于降压药的是A.阿利克仑B.利血
从四川南充寄笔记本电脑到苏州要多少快速费,
厦门禹州大学城去了龙池岩寺怎么坐车
推荐资讯
鄢陵景扬园林绿化工程有限公司地址在哪,我要
芜湖中燃城市燃气发展有限公司这个地址在什么
一般纳税人开材料普通发票税率是多少钱
5x+2x=42 15+2x-3=48 2x+3x+17=37 6x
市皮防所姚沟路诊所怎么去啊,有知道地址的么
大元素使拉克丝眼皮肤可以单独买吗
双胞胎女生英文名
某薄板共振吸声结构吸声峰值频率(共振频率)
读《这书能让你戒烟》对你有哪些戒烟外的启发
咳嗽有白痰是怎么回事吃什么药好
尺度的含义是:[1999-022,2006-005]A.要素
我有两个女儿大思晗小思特启什么网名好
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?