-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: array_get_dec etc. tactics to solve more cases (#5037)
Using `Nat.lt_trans` is too restrictive, and using `Nat.lt_of_lt_of_le` should make this tactic prove more goals. This fixes a regression probably introduced by #3991; at least in some cases before that `apply sizeOf_get` would have solved the goal here. And it’s true that this is now subsumed by `simp`, but because of the order that `macro_rules` are tried, the too restrictive variant with `Nat.lt_trans` would be tried before `simp`, without backtracking. Fixes #5027
- Loading branch information
Showing
3 changed files
with
20 additions
and
4 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
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,16 @@ | ||
inductive Term (α: Type): Type where | ||
| Composite : Array (Term α) → Term α | ||
| Atom: α → Term α | ||
|
||
-- height of a term | ||
def height (f: Term α): Nat := | ||
let rec max_height (a: Array (Term α)) (i: Nat) (m: Nat): Nat := | ||
if h: i < a.size then | ||
-- The recusive call to height used to fail because of a too weak | ||
-- array_get_dec | ||
max_height a (i + 1) (max (height a[i]) m) | ||
else | ||
m | ||
match f with | ||
| .Composite a => 1 + max_height a 0 0 | ||
| .Atom _ => 1 |