@[reducible, inline]
A clause in a CNF.
The literal (i, b)
is satisfied if the assignment to i
agrees with b
.
Equations
Instances For
@[reducible, inline]
A CNF formula.
Literals are identified by members of α
.
Equations
- Std.Sat.CNF α = List (Std.Sat.CNF.Clause α)
Instances For
Evaluating a Clause
with respect to an assignment a
.
Equations
- Std.Sat.CNF.Clause.eval a c = List.any c fun (x : Std.Sat.Literal α) => match x with | (i, n) => a i == n
Instances For
Evaluating a CNF
formula with respect to an assignment a
.
Equations
- Std.Sat.CNF.eval a f = List.all f fun (c : Std.Sat.CNF.Clause α) => Std.Sat.CNF.Clause.eval a c
Instances For
Equations
- Std.Sat.CNF.Sat a f = (Std.Sat.CNF.eval a f = true)
Instances For
Equations
- f.Unsat = ∀ (a : α → Bool), Std.Sat.CNF.eval a f = false
Instances For
instance
Std.Sat.CNF.Clause.instDecidableMemOfDecidableEq
{α : Type u_1}
{v : α}
{c : Clause α}
[DecidableEq α]
:
Equations
- Std.Sat.CNF.Clause.instDecidableMemOfDecidableEq = inferInstanceAs (Decidable ((v, false) ∈ c ∨ (v, true) ∈ c))
Variable v
occurs in CNF
formula f
.
Equations
- Std.Sat.CNF.Mem v f = ∃ (c : Std.Sat.CNF.Clause α), c ∈ f ∧ Std.Sat.CNF.Clause.Mem v c
Instances For
instance
Std.Sat.CNF.instDecidableMemOfDecidableEq
{α : Type u_1}
{v : α}
{f : CNF α}
[DecidableEq α]
:
Equations
- Std.Sat.CNF.instDecidableMemOfDecidableEq = inferInstanceAs (Decidable (∃ (x : Std.Sat.CNF.Clause α), x ∈ f ∧ Std.Sat.CNF.Clause.Mem v x))
instance
Std.Sat.CNF.instDecidableExistsMemOfDecidableEq
{α : Type u_1}
{f : CNF α}
[DecidableEq α]
:
Equations
- Std.Sat.CNF.instDecidableExistsMemOfDecidableEq = decidable_of_iff ((List.any f fun (c : Std.Sat.CNF.Clause α) => !List.isEmpty c) = true) ⋯
theorem
Std.Sat.CNF.mem_of
{α✝ : Type u_1}
{f : CNF α✝}
{c : Clause α✝}
{v : α✝}
(h : c ∈ f)
(w : Clause.Mem v c)
:
Mem v f