-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle reordered indices in structural recursion (#6116)
This PR fixes a bug where structural recursion did not work when indices of the recursive argument appeared as function parameters in a different order than in the argument's type's definition. Fixes #6015.
- Loading branch information
Showing
4 changed files
with
34 additions
and
10 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
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,21 @@ | ||
private axiom test_sorry : ∀ {α}, α | ||
|
||
inductive Tyₛ (l : List Unit): Type | ||
| U : Tyₛ l | ||
open Tyₛ | ||
|
||
inductive Varₚ (d : Unit): List Unit → Type | ||
| vz : Varₚ d [d'] | ||
| vs : Varₚ d l → Varₚ d (Bₛ :: l) | ||
|
||
inductive Tmₛ {l : List Unit}: Tyₛ l → Unit → Type 1 | ||
| arr : (T : Type) → Tmₛ A d → Tmₛ A d | ||
| param : Varₚ d l → Tmₛ A d → Tmₛ (@U l) d | ||
|
||
def TmₛA {l : List Unit} {d : Unit} (nonIndex : Bool) {Aₛ : Tyₛ l} (t : Tmₛ Aₛ d): Type := | ||
match t with | ||
| .arr dom cd => | ||
let cd := TmₛA nonIndex cd | ||
dom → cd | ||
| _ => test_sorry | ||
termination_by structural t |