Gates over the full binary basis #
The gates of fair semi-circuits (Cslib.Circuits.Boolean.SemiCircuit). An argument is a
constant or an internal value named by a natural number, a literal is an argument, possibly
negated, and a gate applies an operation Bool → Bool → Bool of the full binary basis B₂ to
two arguments. Rerouting the internal value v to a literal (Gate.subst) absorbs the negation
into the operation and preserves the value of the gate on assignments giving v the value of the
literal (Gate.eval_subst).
A gate with a constant argument or two equal arguments is degenerate and computes a constant or
a literal of an argument (Gate.eval_lit). Of the sixteen operations of B₂, the affine ones
(IsAffineOp) have no product term; every other operation, an AND-type one, has the form
(a + α)(b + β) + γ (exists_and_form), takes both values (exists_eq_of_not_isAffineOp'), and
is constant on a line of 𝔽₂² on which any other operation is constant (exists_line_const).
An affine operation that is neither constant nor a projection is XOR-type (exists_xor_form).
Main definitions #
Cslib.Circuits.Boolean.SemiCircuit.Arg,Cslib.Circuits.Boolean.SemiCircuit.Lit,Cslib.Circuits.Boolean.SemiCircuit.Gate: arguments, literals and gates.Cslib.Circuits.Boolean.SemiCircuit.Gate.subst: rerouting an internal value to a literal.Cslib.Circuits.Boolean.SemiCircuit.Gate.Degenerate,Cslib.Circuits.Boolean.SemiCircuit.Gate.lit: degenerate gates and the literal they compute.Cslib.Circuits.Boolean.SemiCircuit.IsAffineOp,Cslib.Circuits.Boolean.SemiCircuit.IsUnaryOp: affine operations and projections.
Main results #
Cslib.Circuits.Boolean.SemiCircuit.Gate.eval_subst: rerouting preserves evaluation.Cslib.Circuits.Boolean.SemiCircuit.exists_and_form,Cslib.Circuits.Boolean.SemiCircuit.exists_xor_form,Cslib.Circuits.Boolean.SemiCircuit.exists_line_const: the operations ofB₂.
References #
Arguments, literals and gates #
Instances For
Instances For
The constant literal b.
Instances For
The literal t ⊕ c of the internal value t.
Instances For
The literal reads the internal value t.
Instances For
The gate reads the internal value t.
Instances For
A gate reads at most two internal values.
Degenerate gates #
The literal computed by a gate with a constant argument or two equal arguments.
Instances For
The gate has a constant argument or two equal arguments.
Instances For
Operations of the full binary basis #
An AND-type gate reading two internal values becomes constant once the value w is fixed
suitably.
An operation that is not a projection or a negated projection is constant on a diagonal
{(c + a, a)} for a suitable c, and likewise on {(a, c + a)}.
An operation that is not a projection or a negated projection is constant on a diagonal: a
gate with such an operation reading p and r is constant once p = r + c for a suitable
c.
Of two operations of two bits, one AND-type, both are constant on a common line of 𝔽₂²:
a = c, b = c or a = b + c for a suitable constant c.
A gate reading the internal values x and y computes an operation of their values, which is
affine exactly when the operation of the gate is.