inductive
definition
Constraint
show as:
view math explainer →
open explainer
Read the cached plain-language explainer.
open lean source
IndisputableMonolith.Complexity.SAT.PC on GitHub at line 10.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
-
paired_preserves_balance -
LatticeParams -
constraintsOf -
determinesVar -
extractFromPC -
mentionsVar -
PC -
PeelingData -
PeelingResult -
satisfiesConstraint -
w_z_mass_ratio -
via -
additive_emp_right -
recognition_work_constraint_cert -
uniqueness_on_indep_decomposition -
LedgerEntry -
syncPeriod_11 -
cloning_constraint -
fibonacci_deficit -
current_chain_distinct -
current_chain_unique_modulo_edge_pair_filter -
endpoint_pairs_not_unique -
middle_pair_unique_nonzero -
natural_invariants_D3 -
refinement -
sync_resource_functional_minimized -
choice_symmetric -
lepton_residues_distinct -
InsideSchwarzschild -
classE_count
formal source
7namespace SAT
8
9/-- Constraints are either CNF-clauses or XOR-checks. -/
10inductive Constraint (n : Nat) where
11 | cnf (C : Clause n)
12 | xor (X : XORConstraint n)
13deriving Repr
14
15/-- Whether a variable is mentioned in a literal. -/
16def mentionsVarLit {n} (l : Lit n) (v : Var n) : Bool :=
17 match l with
18 | .pos u => decide (u = v)
19 | .neg u => decide (u = v)
20
21/-- Whether a variable is mentioned in a clause. -/
22def mentionsVarClause {n} (C : Clause n) (v : Var n) : Bool :=
23 C.any (fun l => mentionsVarLit l v)
24
25/-- Whether a variable is mentioned in an XOR constraint. -/
26def mentionsVarXOR {n} (X : XORConstraint n) (v : Var n) : Bool :=
27 X.vars.any (fun u => decide (u = v))
28
29/-- Whether a variable is mentioned in a mixed constraint. -/
30def mentionsVar {n} (K : Constraint n) (v : Var n) : Bool :=
31 match K with
32 | .cnf C => mentionsVarClause C v
33 | .xor X => mentionsVarXOR X v
34
35/-- Satisfaction semantics for mixed constraints. -/
36def satisfiesConstraint {n} (a : Assignment n) (K : Constraint n) : Prop :=
37 match K with
38 | .cnf C => evalClause a C = true
39 | .xor X => parityOf a X.vars = X.parity
40