lean4-htt/tests/elab/cbv3.lean
Wojciech Różowski 7ca47aad7d
feat: add cbv at location syntax (#12773)
This PR adds `at` location syntax to the `cbv` tactic, matching the
interface of `simp at`. Previously `cbv` could only reduce the goal
target; now it supports `cbv at h`, `cbv at h |-`, and `cbv at *`.

`cbvGoal` is rewritten to use `Sym.preprocessMVar` followed by `cbvCore`
within a single `SymM` context, sharing the term table across all
hypotheses and the target. The old `cbvGoalCore` (which reduced one side
of an equation goal at a time) is replaced by a general approach that
reduces arbitrary goal types and hypothesis types, with special handling
for `True` targets and `False` hypotheses. `cbvDecideGoal` is updated to
use the extracted `cbvCore` as well.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 16:12:07 +00:00

21 lines
343 B
Text

set_option cbv.warning false
def f (n : Nat) : Nat := match n with
| 0 => 0
| (n + 1) => (f n) + 1
termination_by n
example : f 1 = f 1 := by cbv
/--
trace: ⊢ False
---
warning: declaration uses `sorry`
-/
#guard_msgs in
example : f 1 = f 2 := by
cbv
trace_state
sorry
example : "hello" ++ " " ++ "world" = "hello world" := by cbv