The two Tseitin transformations agree #
A proposition over the atoms Fin n compiles to a De Morgan gate list on n inputs
(Cslib.Logic.PL.Proposition.deMorganCode): an atom i is input wire i, ⊥ is a constant gate,
∧ and ∨ are gates, and A → B is the gate ¬A ∨ B, written with a negation gate and a
disjunction gate. The list is well formed (Proposition.isCodeFrom_deMorganCode) and its output
wire carries the value of the proposition (Proposition.evalOutput_deMorganCode).
So the Tseitin transformation of the proposition (Cslib.Logic.PL.Proposition.tseitinCNF) and the
Tseitin formula of its gate list with the output fixed to true
(Cslib.Circuits.Boolean.tseitinSatCNF) have the same models on the atoms: for every valuation
v of the atoms, A.tseitinCNF has a model restricting to v exactly when the circuit formula
with the inputs fixed to v is satisfiable, and both hold exactly when A is true at v
(Proposition.exists_eval_tseitinCNF_iff_satisfiable_tseitinSatCNF). The two formulas differ in
their auxiliary variables (subformulas against wires, with an extra wire for each implication) and
in the shape of their clauses, so this projection to the atoms is the sense in which they are
equivalent.
Main definitions #
Cslib.Logic.PL.Proposition.DeMorganCode: a gate list and its output wire.Cslib.Logic.PL.Proposition.deMorganCode: the gate list of a proposition and its output wire.
Main results #
Cslib.Logic.PL.Proposition.isCodeFrom_deMorganCode: the gate list is well formed.Cslib.Logic.PL.Proposition.evalOutput_deMorganCode: its output is the value of the proposition.Cslib.Logic.PL.Proposition.exists_eval_tseitinCNF_iff_satisfiable_tseitinSatCNF: the two Tseitin transformations have the same models on the atoms.
References #
This compilation and the comparison are original.
A De Morgan gate list and the wire carrying its value.
The gates, in order.
- output : ℕ
The wire carrying the value.
The De Morgan gate list of a proposition over Fin n, numbered from gate k (wire n + k)
on, and the wire carrying its value: an atom i is input wire i, ⊥ is a constant gate, ∧
and ∨ are gates after the gates of their arguments, and A → B is ¬A ∨ B.
The output wire of the gate list of a proposition, numbered from gate k on, is an input or
one of its gates.
The gate list of a proposition is well formed: numbered from gate k on, its gates read
only the inputs and earlier gates.
The output wire carries the value of the proposition: after any gates pre numbered
before it, on inputs x of length n, the gate list of A gives its output wire the value of
A at the valuation reading the inputs.
The output of the gate list of a proposition is its value.
The two Tseitin transformations agree on the atoms. For a proposition A over Fin n and
a valuation v of its atoms, the Tseitin transformation A.tseitinCNF has a model whose
restriction to the atoms is v exactly when the circuit Tseitin formula of the gate list of A,
with the output fixed to true and the inputs fixed to v, is satisfiable.