-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize congruence proof step reconstruction. (#135)
* Optimize congruence proof step reconstruction. * Remove redundant tracing information. * Update test output. * Disable test.
- Loading branch information
Showing
4 changed files
with
117 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +0,0 @@ | ||
Test/Nat/Sum'.lean:7:12: error: tactic 'assumption' failed | ||
case zero.a | ||
_uniq✝⁹⁸⁸²⁻⁰ : | ||
¬((∀ (n : Int), sum n = if n = 0 then 0 else n + sum (if 1 ≤ n then n - 1 else 0)) ∧ | ||
(∀ (_uniq.4872 : Int), _uniq.4872 ≥ 0 → sum _uniq.4872 ≥ 0) ∧ Smt.Reconstruct.Builtin.distinct [sum 0, 0]) | ||
⊢ ¬Smt.Reconstruct.andN' [Nat → Nat] ¬sum 0 = 0 * (0 + 1) / 2 | ||
goal: sum (n + 1) = (n + 1) * (n + 1 + 1) / 2 | ||
|
||
query: | ||
(define-sort Nat () Int) | ||
(declare-const n Nat) | ||
(assert (>= n 0)) | ||
(define-fun-rec sum ((n Nat)) Nat (ite (= n 0) 0 (+ n (sum (ite (<= 1 n) (- n 1) 0))))) | ||
(assert (forall ((_uniq.10852 Nat)) (=> (>= _uniq.10852 0) (>= (sum _uniq.10852) 0)))) | ||
(assert (= (sum n) (div (* n (+ n 1)) 2))) | ||
(assert (distinct (sum (+ n 1)) (div (* (+ n 1) (+ (+ n 1) 1)) 2))) | ||
(check-sat) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import Smt | ||
-- import Smt | ||
|
||
def sum (n : Nat) : Nat := if n = 0 then 0 else n + sum (n - 1) | ||
-- def sum (n : Nat) : Nat := if n = 0 then 0 else n + sum (n - 1) | ||
|
||
theorem sum_formula : sum n = n * (n + 1) / 2 := by | ||
induction n with | ||
| zero => smt [sum]; rfl | ||
| succ n ih => | ||
smt_show [sum, ih] | ||
sorry | ||
-- theorem sum_formula : sum n = n * (n + 1) / 2 := by | ||
-- induction n with | ||
-- | zero => smt_show [sum]; rfl | ||
-- | succ n ih => | ||
-- smt_show [sum, ih] | ||
-- sorry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters