CSC2512—Assignments
Assignment 1, implement a converter from
first-order logic to CNF.
The
DIMACS format taken as input by most SAT solvers is
simply specified:
c
c start with comments
c
c
p cnf 5 3
1 -5 4 0
-1 5 3 4 0
-3 -4 0
- The file can start with comments,
that is lines begining with the character
c.
- Right after the comments, there is the line p cnf nbvar nbclauses indicating that the instance is in CNF
format; nbvar is the exact number of variables
appearing in the file; nbclauses is the exact
number of clauses contained in the file.
- Then the clauses follow. Each clause is a sequence of
distinct non-null numbers between -nbvar and nbvar ending with 0 on the same line; it cannot
contain the opposite literals i and -i simultaneously. Positive numbers denote the
corresponding variables. Negative numbers denote the negations of the
corresponding variables.