Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Jan 23, 2025
1 parent 3081ca5 commit 63ad38b
Showing 1 changed file with 62 additions and 2 deletions.
64 changes: 62 additions & 2 deletions tests/lean/run/zetaUnused.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,65 @@

/--
warning: declaration uses 'sorry'
---
info: b : Bool
⊢ if b = true then
let_fun unused := ();
True
else False
-/
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
trace_state; sorry

/--
warning: declaration uses 'sorry'
---
info: b : Bool
⊢ b = true
-/
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
simp; trace_state; sorry

/--
warning: declaration uses 'sorry'
---
info: b : Bool
⊢ b = true ∧
let_fun unused := ();
True
-/
#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

/--
warning: declaration uses 'sorry'
---
info: b : Bool
⊢ if b = true then True else False
-/
#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


/--
warning: declaration uses 'sorry'
---
info: b : Bool
⊢ if b = true then True else False
-/
#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:
Expand All @@ -15,6 +76,5 @@ h✝ : b = true
#guard_msgs in
example (b : Bool) : if b then have unused := (); True else False := by
split
· trace_state
sorry
· trace_state; sorry
· sorry

0 comments on commit 63ad38b

Please sign in to comment.