Our representation (syntax and semantics) for conjunctive normal
To express what it means to call a SAT solver, we need a
representation and a semantics for Boolean formulas in conjunctive normal form.
Our syntax is as follows:
- A variable is a natural number. To help keep variables separate
from literals, we represent them varps, instead of natps.
- A literal represents either a variable or a negated variable. We
represent these using a typical numeric encoding: the least significant bit is
the negated bit, and the remaining bits are the variable. See litp.
- A clause is a disjunction of literals. We represent these as
ordinary lists of literals. See lit-listp.
- A formula is a conjunction of clauses. We represent these using
The semantics of these formulas are given by eval-formula.
- Representation of a literal (a Boolean variable or its negation).
- Representation of a Boolean variable.
- A bit array that serves as the environment for eval-formula.
- Semantics of CNF formulas.
- Maximum index of any identifier used anywhere in a formula.
- Maximum index of any identifier used anywhere in a clause.
- Collect indices of all identifiers used throughout a formula.
- Collect indices of all identifiers used throughout a clause.