Skip to content

Commit

Permalink
removed unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhartha-gadgil committed Jan 22, 2024
1 parent 44b64b9 commit 36cb95f
Show file tree
Hide file tree
Showing 11 changed files with 630 additions and 649 deletions.
4 changes: 1 addition & 3 deletions Saturn/Clause.lean
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ theorem contradiction_is_false (n: Nat) : ∀ valuation : Valuation n,
fun valuation => fun ⟨k, ⟨b, p⟩⟩ =>
let lem1 : (contradiction n).get k b = none := by rw [contra_at_none n]
let lem2 : varSat ((contradiction n).get k b) = varSat none := congrArg varSat lem1
let lem3 : varSat ((contradiction n).get k b) (valuation.get k b) =
varSat none (valuation.get k b) := congr lem2 rfl
let lem4 : (varSat none (valuation.get k b)) = (none = some (valuation.get k b)) := rfl
let lem5 : (none = some (valuation.get k b)) := by
rw [← lem4]
Expand Down Expand Up @@ -150,7 +148,7 @@ def someUnitClauseAux {l : Nat} {n : Nat}: (clauses : Vector (Clause (n + 1)) l)
Option (SomeUnitClause clauses) :=
fun clauses posCount negCount cb =>
match cb with
| zero => fun cbBound optCl => optCl
| zero => fun _ optCl => optCl
| m + 1 =>
fun cbBound optCl =>
match optCl with
Expand Down
163 changes: 79 additions & 84 deletions Saturn/Containment.lean

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Saturn/Core.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ corresponding to its satisfiability. Also a theorem that `isSat` and `isUnsat` a
exclusive.
-/

def FinSeq (n: Nat) (α : Type) : Type := (k : Nat) → k < n → α
@[inline] def FinSeq (n: Nat) (α : Type) : Type := (k : Nat) → k < n → α

inductive Vector (α : Type) : Nat → Type where
| nil : Vector α zero
Expand All @@ -20,9 +20,9 @@ namespace Vector
def get {α : Type}{n : Nat}(v: Vector α n) : FinSeq n α :=
fun j jw =>
match n, v, j, jw with
| .(zero), nil, k, lt => nomatch lt
| m + 1, cons head tail, zero, lt => head
| m + 1, cons head tail, j + 1, w => tail.get j (Nat.le_of_succ_le_succ w)
| .(zero), nil, _, lt => nomatch lt
| _ + 1, cons head _, zero, _ => head
| _ + 1, cons _ tail, j + 1, w => tail.get j (Nat.le_of_succ_le_succ w)
end Vector

abbrev Clause(n : Nat) : Type := Vector (Option Bool) n
Expand Down
2 changes: 1 addition & 1 deletion Saturn/DPLL.lean
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def lengthOneEqual{cl1 cl2 : Clause 1}(eql : cl1.get zero (zero_lt_succ zero) =
(funext (fun j =>
match j with
| zero => funext (fun _ => eql)
| i + 1 => funext (fun jw => nomatch jw)
| _ + 1 => funext (fun jw => nomatch jw)
))

def lengthOneUnit{cl: Clause 1}{b : Bool}(eql : cl.get zero (zero_lt_succ zero) = some b):
Expand Down
Loading

0 comments on commit 36cb95f

Please sign in to comment.