-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
178 additions
and
21 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
276.lean:5:27-5:50: error: failed to elaborate eliminator, expected type is not available | ||
fun {α : Sort v} => @?m α : {α : Sort v} → @?m α | ||
fun {α : Sort v} => ?m(α) : {α : Sort v} → @?m α | ||
276.lean:9:33-9:56: error: failed to elaborate eliminator, expected type is not available |
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,47 @@ | ||
/-! | ||
# Syntax to create delayed assignment metavariables | ||
-/ | ||
|
||
/-! | ||
Creating and reusing some synthetic holes using delayed assignment syntax. | ||
-/ | ||
example : True := by | ||
let f : Nat → Nat := fun x => ?a | ||
let g : Nat → Nat → Nat := fun x y => ?b + ?b(x := 1) + ?b(y := 1) + ?a(x) + ?a(x := y) | ||
let v := ?b(x := 4, y := 6) | ||
trace_state | ||
case b => exact 3 * x + y | ||
trace_state | ||
case a => exact x + 2 | ||
trace_state | ||
trivial | ||
|
||
/-! | ||
Error: out of order | ||
-/ | ||
example : True := by | ||
let f : Nat → Nat → Nat := fun x y => ?a | ||
let v := ?a(y := 1, x := 2) | ||
|
||
/-! | ||
Error: forward dependencies | ||
-/ | ||
example : True := by | ||
let f : (n : Nat) → (m : Fin n) → Nat := fun n m => ?a | ||
let v := ?a(n := 1) | ||
|
||
/-! | ||
Using a metavariable later in a different context. | ||
-/ | ||
example : (∀ x : Nat, x = x) ∧ (∀ x : Nat, x = x) := by | ||
refine ⟨fun x => ?a, ?_⟩ | ||
· rfl | ||
· intro y | ||
exact ?a(x := y) | ||
|
||
/-! | ||
Using the metavariable later in a different context, in the same term. | ||
-/ | ||
example : (∀ x : Nat, x = x) ∧ (∀ x : Nat, x = x) := by | ||
refine ⟨fun x => ?a(x), fun x => ?a(x)⟩ | ||
· rfl |
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,40 @@ | ||
f : Nat → Nat := fun x => ?a(x) | ||
g : Nat → Nat → Nat := fun x y => ?b(x, y) + ?b(y, x := 1) + ?b(x, y := 1) + ?a(x) + ?a(x := y) | ||
v : Nat := ?b(x := 4, y := 6) | ||
⊢ True | ||
|
||
case b | ||
f : Nat → Nat := fun x => ?a(x) | ||
x y : Nat | ||
⊢ Nat | ||
|
||
case a | ||
x : Nat | ||
⊢ Nat | ||
f : Nat → Nat := fun x => ?a(x) | ||
g : Nat → Nat → Nat := fun x y => 3 * x + y + (3 * 1 + y) + (3 * x + 1) + ?a(x) + ?a(x := y) | ||
v : Nat := 3 * 4 + 6 | ||
⊢ True | ||
|
||
case a | ||
x : Nat | ||
⊢ Nat | ||
f : Nat → Nat := fun x => x + 2 | ||
g : Nat → Nat → Nat := fun x y => 3 * x + y + (3 * 1 + y) + (3 * x + 1) + (x + 2) + (y + 2) | ||
v : Nat := 3 * 4 + 6 | ||
⊢ True | ||
delayedMVarSyntax.lean:24:11-24:29: error: local variables in delayed assignment syntax must appear in order according to the metavariable's local context: | ||
case a | ||
x y : Nat | ||
⊢ Nat | ||
delayedMVarSyntax.lean:22:18-24:29: error: unsolved goals | ||
f : Nat → Nat → Nat := fun x y => ?a(x, y) | ||
⊢ True | ||
delayedMVarSyntax.lean:31:11-31:21: error: local variables in delayed assignment syntax must not have forward dependencies in the metavariable's local context: | ||
case a | ||
n : Nat | ||
m : Fin n | ||
⊢ Nat | ||
delayedMVarSyntax.lean:29:18-31:21: error: unsolved goals | ||
f : (n : Nat) → Fin n → Nat := fun n m => ?a(n, m) | ||
⊢ True |
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,4 +1,4 @@ | ||
fun α [Repr α] => repr : (α : Type u_1) → [inst : Repr α] → α → Std.Format | ||
fun x y => x : (x : ?m) → ?m x → ?m | ||
funParen.lean:4:12-4:16: error: invalid pattern, constructor or constant marked with '[match_pattern]' expected | ||
fun x => ?m x : (x : ?m) → ?m x | ||
fun x => ?m(x✝ := x) : (x : ?m) → ?m x |
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
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
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,4 +1,4 @@ | ||
fun x => ?m x | ||
fun x => ?m(x) | ||
none | ||
(some (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) | ||
0 | ||
|