Skip to content

Commit 0e31c42

Browse files
committed
Update the syntax of the pretty-printed let equalities
1 parent e21347f commit 0e31c42

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

backends/lean/Aeneas/Progress/Progress.lean

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ open Utils
1414
/-- A special definition that we use to introduce pretty-printed terms in the context -/
1515
def prettyMonadEq {α : Type u} (x : Std.Result α) (y : α) : Prop := x = .ok y
1616

17-
macro:max "[> " "let" y:term " ← " x:term : term => `(prettyMonadEq $x $y)
17+
macro:max "[> " "let" y:term " ← " x:term " <]" : term => `(prettyMonadEq $x $y)
1818

1919
@[app_unexpander prettyMonadEq]
20-
def unexpPrettyMonadEqofNat : Lean.PrettyPrinter.Unexpander | `($_ $x $y) => `([> let $y ← $x) | _ => throw ()
20+
def unexpPrettyMonadEqofNat : Lean.PrettyPrinter.Unexpander | `($_ $x $y) => `([> let $y ← $x <]) | _ => throw ()
2121

22-
example (x y z : Std.U32) (_ : [> let z ← (x + y)) : True := by simp
22+
example (x y z : Std.U32) (_ : [> let z ← (x + y) <]) : True := by simp
2323

2424
theorem eq_imp_prettyMonadEq {α : Type u} {x : Std.Result α} {y : α} (h : x = .ok y) : prettyMonadEq x y := by simp [prettyMonadEq, h]
2525

@@ -612,7 +612,7 @@ info: example
612612
(y : UScalar ty)
613613
(h : ↑x + ↑y ≤ UScalar.max ty)
614614
(z : UScalar ty)
615-
(_ : [> let z ← x + y)
615+
(_ : [> let z ← x + y <])
616616
(h1 : ↑z = ↑x + ↑y) :
617617
↑z = ↑x + ↑y
618618
:= by sorry
@@ -632,10 +632,10 @@ info: example
632632
(y : UScalar ty)
633633
(h : 2 * ↑x + ↑y ≤ UScalar.max ty)
634634
(z1 : UScalar ty)
635-
(__1 : [> let z1 ← x + y)
635+
(__1 : [> let z1 ← x + y <])
636636
(h1 : ↑z1 = ↑x + ↑y)
637637
(z2 : UScalar ty)
638-
(_ : [> let z2 ← z1 + x)
638+
(_ : [> let z2 ← z1 + x <])
639639
(h2 : ↑z2 = ↑z1 + ↑x) :
640640
↑z2 = 2 * ↑x + ↑y
641641
:= by sorry

backends/lean/Aeneas/Progress/ProgressStar.lean

+4-4
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ b : Bool
445445
x y : U32
446446
h✝ : b = true
447447
x2 : U32
448-
_ : [> let x2 ← x + y
448+
_ : [> let x2 ← x + y <]
449449
x2_post : ↑x2 = ↑x + ↑y
450450
⊢ ↑x2 + ↑x2 ≤ U32.max
451451
@@ -454,10 +454,10 @@ b : Bool
454454
x y : U32
455455
h✝ : b = true
456456
x2 : U32
457-
_✝ : [> let x2 ← x + y
457+
_✝ : [> let x2 ← x + y <]
458458
x2_post : ↑x2 = ↑x + ↑y
459459
x3 : U32
460-
_ : [> let x3 ← x2 + x2
460+
_ : [> let x3 ← x2 + x2 <]
461461
x3_post : ↑x3 = ↑x2 + ↑x2
462462
⊢ ↑x3 + ↑4#u32 ≤ U32.max
463463
@@ -472,7 +472,7 @@ b : Bool
472472
x y✝ : U32
473473
h✝ : ¬b = true
474474
y : U32
475-
_ : [> let y ← x + y✝
475+
_ : [> let y ← x + y✝ <]
476476
y_post : ↑y = ↑x + ↑y✝
477477
⊢ ↑y + ↑2#u32 ≤ U32.max
478478
-/

0 commit comments

Comments
 (0)