• Top
    • Documentation
    • Books
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
        • Sat-solver-options
        • Config-p
        • Logical-story
        • Dimacs
        • Gather-benchmarks
        • Cnf
          • Litp
          • Varp
          • Env$
          • Eval-formula
          • Max-index-formula
          • Max-index-clause
          • Formula-indices
          • Clause-indices
        • Satlink-extra-hook
        • Sat
      • Truth
      • Ubdds
      • Bdd
      • Faig
      • Bed
      • 4v
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Satlink

Cnf

Our representation (syntax and semantics) for conjunctive normal form formulas.

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 lit-list-listp.

The semantics of these formulas are given by eval-formula.

Subtopics

Litp
Representation of a literal (a Boolean variable or its negation).
Varp
Representation of a Boolean variable.
Env$
A bit array that serves as the environment for eval-formula.
Eval-formula
Semantics of CNF formulas.
Max-index-formula
Maximum index of any identifier used anywhere in a formula.
Max-index-clause
Maximum index of any identifier used anywhere in a clause.
Formula-indices
Collect indices of all identifiers used throughout a formula.
Clause-indices
Collect indices of all identifiers used throughout a clause.