-
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.
feat: enable
pp.fieldNotation.generalized
globally (#3744)
Sets the default value to `pp.fieldNotation.generalized` to `true`. Updates tests, and fixes some minor flaws in the implementation of the generalized field notation pretty printer. Now generalized field notation won't be used for any function that has a `motive` argument. This is intended to prevent recursors from pretty printing using it as (1) recursors are more like control flow structures than actual functions and (2) generalized field notation tends to cause elaboration problems for recursors. Note: be sure functions that have an `@[app_unexpander]` use `@[pp_nodot]` if applicable. For example, `List.toArray` needs `@[pp_nodot]` to ensure the unexpander prints it using `#[...]` notation.
- Loading branch information
Showing
72 changed files
with
293 additions
and
303 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
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 @@ | ||
n : Nat | ||
f : Fin (Nat.succ n) | ||
f : Fin n.succ | ||
⊢ foo f = 0 |
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 @@ | ||
theorem ex1 : ∀ {p q : Prop}, (p ↔ q) → P q → P p := | ||
fun {p q} h h' => Eq.mpr (id (propext (P_congr p q h))) h' | ||
fun {p q} h h' => (id (propext (P_congr p q h))).mpr h' | ||
theorem ex2 : ∀ {p q : Prop}, p = q → P q → P p := | ||
fun {p q} h h' => Eq.mpr (id (propext (P_congr p q (Iff.of_eq h)))) h' | ||
fun {p q} h h' => (id (propext (P_congr p q (Iff.of_eq h)))).mpr h' |
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,12 +1,12 @@ | ||
2161.lean:15:48-15:54: error: tactic 'decide' failed for proposition | ||
mul (mul (mul 4 1) 1) 1 = 4 | ||
((mul 4 1).mul 1).mul 1 = 4 | ||
since its 'Decidable' instance reduced to | ||
Decidable.rec (fun h => (fun h => isFalse ⋯) h) (fun h => (fun h => h ▸ isTrue ⋯) h) | ||
(instDecidableEqNat (mul (mul (mul 4 1) 1) 1).num 4) | ||
(instDecidableEqNat (((mul 4 1).mul 1).mul 1).num 4) | ||
rather than to the 'isTrue' constructor. | ||
2161.lean:22:48-22:54: error: tactic 'decide' failed for proposition | ||
add (add (add 4 1) 1) 1 = 4 | ||
((add 4 1).add 1).add 1 = 4 | ||
since its 'Decidable' instance reduced to | ||
Decidable.rec (fun h => (fun h => isFalse ⋯) h) (fun h => (fun h => h ▸ isTrue ⋯) h) | ||
(instDecidableEqNat (add (add (add 4 1) 1) 1).num 4) | ||
(instDecidableEqNat (((add 4 1).add 1).add 1).num 4) | ||
rather than to the 'isTrue' constructor. |
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 @@ | ||
Set.insert (Set.insert (Set.insert Set.empty 1) 2) 3 : Set Nat | ||
((Set.empty.insert 1).insert 2).insert 3 : Set Nat | ||
fun x y => g { x := x, y := y } : Nat → Nat → Nat | ||
fun x y => Set.insert (Set.insert Set.empty x) y : Nat → Nat → Set Nat | ||
fun x y => (Set.empty.insert x).insert y : Nat → Nat → Set Nat | ||
fun x y => { x := x, y := y } : Nat → Nat → Point |
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,8 +1,8 @@ | ||
let y := Nat.zero; | ||
Nat.add y y | ||
fun y_1 => Nat.add y y_1 | ||
y.add y | ||
fun y_1 => y.add y_1 | ||
fun y => Nat.add _fvar.1 y | ||
fun (y : Nat) => Nat.add y y | ||
Nat.add ?m y | ||
?m.add y | ||
Nat.add (?m #0) #0 | ||
fun y => Nat.add (Nat.add y y) y | ||
fun y => (y.add y).add y |
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 @@ | ||
550.lean:3:2-3:6: error: unsolved goals | ||
x : Nat | ||
h : ∀ (x : Nat), x + 1 = Nat.succ x | ||
⊢ Nat.succ (x + 1) = 1 + (x + 1) | ||
h : ∀ (x : Nat), x + 1 = x.succ | ||
⊢ (x + 1).succ = 1 + (x + 1) |
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,14 +1,14 @@ | ||
i j : Nat | ||
a : Array Nat | ||
v : Nat | ||
h₁ : i < Array.size a | ||
h₂ : j < Array.size a | ||
h₁ : i < a.size | ||
h₂ : j < a.size | ||
h₃ : i = j | ||
⊢ f a i v h₁ = f a j v h₂ | ||
i j : Nat | ||
a : Array Nat | ||
v : Nat | ||
h₁ : 0 + i < Array.size a | ||
h₂ : j < Array.size a | ||
h₁ : 0 + i < a.size | ||
h₂ : j < a.size | ||
h₃ : i = j | ||
⊢ f a i v (Nat.zero_add i ▸ h₁) = f a j v h₂ | ||
⊢ f a i v (i.zero_add ▸ h₁) = f a j v h₂ |
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ case z | |
case s | ||
a✝ : Nat | ||
a_ih✝ : add Nat.z a✝ = a✝ | ||
⊢ add Nat.z (Nat.s a✝) = Nat.s a✝ | ||
⊢ add Nat.z a✝.s = a✝.s |
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,2 +1,2 @@ | ||
constructor Ring.mk.{u} : {R : Type u} → [toZero : Zero R] → (gsmul : Int → R → R) → (∀ (a : R), gsmul 0 a = 0) → Ring R | ||
Ring.mk (fun x n => Int.toNat x * n) ⋯ : Ring Nat | ||
Ring.mk (fun x n => x.toNat * n) ⋯ : Ring Nat |
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,5 +1,5 @@ | ||
[Meta.debug] >> fun x => Nat.add | ||
[Meta.debug] >> Nat.add | ||
[Meta.debug] >> HAdd.hAdd 1 | ||
[Meta.debug] >> fun x y z => Nat.add z y | ||
[Meta.debug] >> fun y => Nat.add y y | ||
[Meta.debug] >> fun x y z => z.add y | ||
[Meta.debug] >> fun y => y.add y |
Oops, something went wrong.