lean4-htt/tests/lean/run/zetaUnused.lean
Kyle Miller 3854ba87b6
feat: pretty print letFun using have syntax (#8372)
This PR modifies the pretty printer to use `have` syntax instead of
`let_fun` syntax.
2025-05-16 15:10:01 +00:00

80 lines
1.8 KiB
Text

/--
trace: b : Bool
⊢ if b = true then
have unused := ();
True
else False
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
trace_state; sorry
/--
trace: b : Bool
⊢ b = true
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
simp; trace_state; sorry
/--
trace: b : Bool
⊢ b = true ∧
have unused := ();
True
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
simp (config := Lean.Meta.Simp.neutralConfig); trace_state; sorry
/-- error: simp made no progress -/
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
simp (config := Lean.Meta.Simp.neutralConfig) only; trace_state; sorry
/--
trace: b : Bool
⊢ if b = true then True else False
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
simp (config := Lean.Meta.Simp.neutralConfig) +zeta only; trace_state; sorry
/--
trace: b : Bool
⊢ if b = true then True else False
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
simp (config := Lean.Meta.Simp.neutralConfig) +zetaUnused only; trace_state; sorry
-- Before the introduction of zetaUnused, split would do collateral damage to unused letFuns.
-- Now they are preserved:
/--
trace: case isTrue
b : Bool
h✝ : b = true
⊢ have unused := ();
True
---
warning: declaration uses 'sorry'
-/
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
split
· trace_state; sorry
· sorry