Zulip Chat Archive
Stream: lean4
Topic: rewrite with the goal
Aaron Liu (Sep 07 2025 at 22:07):
This is probably not supposed to happen
set_option pp.instantiateMVars false
example : 1 = 2 := by
-- error: don't know how to synthesize placeholder
refine ?k
-- trying to print the term will stack overflow
-- show_term
rw [?k]
Aaron Liu (Sep 07 2025 at 22:10):
(you're also not supposed to rewrite the goal with itself, but that's not the point)
Robin Arnez (Sep 07 2025 at 22:14):
Wow, the one thing I forgot to mention about simpa:
/--
error: Occurs check failed: Expression
?k
contains the goal ?k
-/
#guard_msgs in
example : 1 = 2 := by
refine ?k
simpa using ?k
Aaron Liu (Sep 07 2025 at 22:15):
yes, that was the inspiration :)
Aaron Liu (Sep 07 2025 at 22:19):
cases also seems to have this problem
example : 1 = 2 := by
refine ?k
cases ?k
Kyle Miller (Sep 07 2025 at 22:19):
The occurs check in simpa is almost a year old. There are plenty more examples of this bug out there!
Kyle Miller (Sep 08 2025 at 14:04):
lean4#10306 adds an occurs check for rw
Last updated: Dec 20 2025 at 21:32 UTC