-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: nontermination when generating the match-expression splitter the…
…orem (#6146) This PR fixes a non-termination bug that occurred when generating the match-expression splitter theorem. The bug was triggered when the proof automation for the splitter theorem repeatedly applied `injection` to the same local declaration, as it could not be removed due to forward dependencies. See issue #6065 for an example that reproduces this issue. closes #6065
- Loading branch information
1 parent
9cf8370
commit fc4305a
Showing
2 changed files
with
60 additions
and
22 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
def foo (r : Nat) : Nat := | ||
match r with | ||
| Nat.zero => 0 | ||
| l@(Nat.succ _) => | ||
match l with | ||
| 0 => 0 | ||
| Nat.succ ll => | ||
match ll with | ||
| Nat.succ _ => 0 | ||
| _ => 0 | ||
|
||
example {r : Nat} : foo r = 0 := by | ||
simp only [foo.eq_def] | ||
guard_target =ₛ | ||
(match r with | ||
| Nat.zero => 0 | ||
| l@h:(Nat.succ n) => | ||
match l, h with | ||
| 0, h => 0 | ||
| Nat.succ ll, h => | ||
match ll, h with | ||
| Nat.succ n_1, h => 0 | ||
| x, h => 0) = | ||
0 | ||
sorry |