Implement a SAT solver from scratch.(See Russell and Norvig,
来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:英语作业 时间:2024/06/13 18:12:37
Implement a SAT solver from scratch.(See Russell and Norvig,Ch.7 for
details on the SAT problem.) Your solver should read a satis\x0cability problem
in conjunctive normal form,in DIMACS format (see below),from standard
input.The output should be A satis\x0cying 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 \x0cle starts with comments (each line starts with
c).The number of variables and the number of clauses is de\x0cned by the line p
cnf variables clauses Each of the next lines speci\x0ces 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
有人知道怎麼做吗?那个output是什麼回事
details on the SAT problem.) Your solver should read a satis\x0cability problem
in conjunctive normal form,in DIMACS format (see below),from standard
input.The output should be A satis\x0cying 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 \x0cle starts with comments (each line starts with
c).The number of variables and the number of clauses is de\x0cned by the line p
cnf variables clauses Each of the next lines speci\x0ces 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
有人知道怎麼做吗?那个output是什麼回事
Implement a SAT solver from scratch.(See Russell and Norvig,Ch.7 for
details on the SAT problem.) Your solver should read a satis\x0cability problem
in conjunctive normal form,in DIMACS format (see below),from standard
input.The output should be A satis\x0cying 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 \x0cle starts with comments (each line starts with
c).The number of variables and the number of clauses is de\x0cned by the line p
cnf variables clauses Each of the next lines speci\x0ces 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
details on the SAT problem.) Your solver should read a satis\x0cability problem
in conjunctive normal form,in DIMACS format (see below),from standard
input.The output should be A satis\x0cying 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 \x0cle starts with comments (each line starts with
c).The number of variables and the number of clauses is de\x0cned by the line p
cnf variables clauses Each of the next lines speci\x0ces 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
英语翻译Everything starts from scratch,and a skyscraper is built
from scratch怎么念
starting from scratch是什么意思
Development from scratch
build from scratch是什么意思
什么叫"create an account from a scratch"?
英语翻译F:information1:develop and implement a program to ensure
scratch her tummy and give her a liver snout.
1.Implement a C++ program which reads any integer from a use
Everything stars from scratch是什么意思?
starting from scratch 如何翻译
英语翻译1.DNA polymerase cannot start a DNA strand from scratch,