An inductive datatype used specifically for the output of the reduce
function. The intended
meaning of each constructor is explained in the docstring of the reduce
function.
- encounteredBoth: {α : Type u} → Std.Tactic.BVDecide.LRAT.Internal.ReduceResult α
- reducedToEmpty: {α : Type u} → Std.Tactic.BVDecide.LRAT.Internal.ReduceResult α
- reducedToUnit: {α : Type u} → Std.Sat.Literal α → Std.Tactic.BVDecide.LRAT.Internal.ReduceResult α
- reducedToNonunit: {α : Type u} → Std.Tactic.BVDecide.LRAT.Internal.ReduceResult α
Instances For
Typeclass for clauses. An instance [Clause α β]
indicates that β
is the type of a clause with
variables of type α
.
- toList : β → Std.Sat.CNF.Clause α
- not_tautology : ∀ (c : β) (l : Std.Sat.Literal α), ¬l ∈ Std.Tactic.BVDecide.LRAT.Internal.Clause.toList c ∨ ¬l.negate ∈ Std.Tactic.BVDecide.LRAT.Internal.Clause.toList c
- ofArray : Array (Std.Sat.Literal α) → Option β
Returns none if the given array contains complementary literals
- ofArray_eq : ∀ (arr : Array (Std.Sat.Literal α)), (∀ (i j : Fin arr.size), ↑i ≠ ↑j → arr[i] ≠ arr[j]) → ∀ (c : β), Std.Tactic.BVDecide.LRAT.Internal.Clause.ofArray arr = some c → Std.Tactic.BVDecide.LRAT.Internal.Clause.toList c = arr.toList
- empty : β
- empty_eq : Std.Tactic.BVDecide.LRAT.Internal.Clause.toList Std.Tactic.BVDecide.LRAT.Internal.Clause.empty = []
- unit : Std.Sat.Literal α → β
- unit_eq : ∀ (l : Std.Sat.Literal α), Std.Tactic.BVDecide.LRAT.Internal.Clause.toList (Std.Tactic.BVDecide.LRAT.Internal.Clause.unit l) = [l]
- isUnit : β → Option (Std.Sat.Literal α)
- isUnit_iff : ∀ (c : β) (l : Std.Sat.Literal α), Std.Tactic.BVDecide.LRAT.Internal.Clause.isUnit c = some l ↔ Std.Tactic.BVDecide.LRAT.Internal.Clause.toList c = [l]
- negate : β → Std.Sat.CNF.Clause α
- negate_eq : ∀ (c : β), Std.Tactic.BVDecide.LRAT.Internal.Clause.negate c = List.map Std.Sat.Literal.negate (Std.Tactic.BVDecide.LRAT.Internal.Clause.toList c)
- insert : β → Std.Sat.Literal α → Option β
Returns none if the result is a tautology.
- delete : β → Std.Sat.Literal α → β
- delete_iff : ∀ (c : β) (l l' : Std.Sat.Literal α), l' ∈ Std.Tactic.BVDecide.LRAT.Internal.Clause.toList (Std.Tactic.BVDecide.LRAT.Internal.Clause.delete c l) ↔ l' ≠ l ∧ l' ∈ Std.Tactic.BVDecide.LRAT.Internal.Clause.toList c
- contains : β → Std.Sat.Literal α → Bool
- contains_iff : ∀ (c : β) (l : Std.Sat.Literal α), Std.Tactic.BVDecide.LRAT.Internal.Clause.contains c l = true ↔ l ∈ Std.Tactic.BVDecide.LRAT.Internal.Clause.toList c
- reduce : β → Array Std.Tactic.BVDecide.LRAT.Internal.Assignment → Std.Tactic.BVDecide.LRAT.Internal.ReduceResult α
Reduces the clause with respect to the given assignment
Instances
Equations
- Std.Tactic.BVDecide.LRAT.Internal.Clause.instDecidableEvalLiteral p l = inferInstanceAs (Decidable (p l.fst = l.snd))
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Std.Tactic.BVDecide.LRAT.Internal.Clause.instInhabited = { default := Std.Tactic.BVDecide.LRAT.Internal.Clause.empty }
The DefaultClause
structure is primarily a list of literals. The additional field nodupkey
is
included to ensure that not_tautology
is provable (which is needed to prove sat_of_insertRup
and sat_of_insertRat
in LRAT.Formula.Internal.RupAddSound
and LRAT.Formula.Internal.RatAddSound
).
The additional field nodup
is included to ensure that delete
can be implemented by simply calling
erase
on the clause
field. Without nodup
, it would be necessary to iterate through the entire
clause
field and erase all instances of the literal to be deleted, since there would potentially
be more than one.
In principle, one could combine nodupkey
and nodup
to instead have one additional field that
stipulates that ∀ l1 : PosFin numVarsSucc, ∀ l2 : PosFin numVarsSucc, l1.1 ≠ l2.1
. This would work
just as well, and the only reason that DefaultClause
is structured in this manner is that the
nodup
field was only included in a later stage of the verification process when it became clear
that it was needed.
- clause : Std.Sat.CNF.Clause (Std.Tactic.BVDecide.LRAT.Internal.PosFin numVarsSucc)
- nodup : List.Nodup self.clause
Instances For
Equations
- Std.Tactic.BVDecide.LRAT.Internal.instBEqDefaultClause = { beq := Std.Tactic.BVDecide.LRAT.Internal.beqDefaultClause✝ }
Equations
- c.toList = c.clause
Instances For
Equations
- Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.empty = { clause := [], nodupkey := ⋯, nodup := ⋯ }
Instances For
Equations
- Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.unit l = { clause := [l], nodupkey := ⋯, nodup := ⋯ }
Instances For
Instances For
Instances For
Attempts to add the literal (idx, b)
to clause c
. Returns none if doing so would make c
a
tautology.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- c.delete l = { clause := List.erase c.clause l, nodupkey := ⋯, nodup := ⋯ }
Instances For
Equations
- c.contains l = List.contains c.clause l
Instances For
Instances For
The reduce
function takes in a clause c
and takes in an array of assignments and attempts to
eliminate every literal in the clause that is not compatible with the assignments
argument.
- If
reduce
returnsencounteredBoth
, then this means that theassignments
array has aboth
Assignment and is therefore fundamentally unsatisfiable. - If
reduce
returnsreducedToEmpty
, then this means that every literal inc
is incompatible withassignments
. In other words, this means that the conjunction ofassignments
andc
is unsatisfiable. - If
reduce
returnsreducedToUnit l
, then this means that every literal inc
is incompatible withassignments
except forl
. In other words, this means that the conjunction ofassignments
andc
entaill
. - If
reduce
returnsreducedToNonunit
, then this means that there are multiple literals inc
that are compatible withassignments
. This is a failure condition forconfirmRupHint
(inLRAT.Formula.Implementation.lean
) which callsreduce
.
Equations
- c.reduce assignments = List.foldl (Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.reduce_fold_fn assignments) Std.Tactic.BVDecide.LRAT.Internal.ReduceResult.reducedToEmpty c.clause