lean4-htt/tests/lean/run/replayConst.lean
Joachim Breitner 2907df22ec
feat: one axiom per native computation (#12217)
This PR implements RFC #12216: native computation (`native_decide`,
`bv_decide`) is represented in the logic as one axiom per computation,
asserting the equality that was obtained from the native computation.
`#print axiom` will no longer show `Lean.trustCompiler`, but rather the
auto-generated names of these axioms (with, for example,
`._native.bv_decide.` in the name). See the RFC for more information.


This PR introduces a common MetaM helper (`nativeEqTrue`) used by
`native_decide` and `bv_decide` alike that runs the computation and then
asserts the result using an axiom.

It also deprecated the `ofReduceBool` axioms etc.

Not included in this PR is infrastructure for enumerating these axioms,
prettier `#print axioms` (should we want his) and tactic concurrency.

Fixes #12216.
2026-02-03 10:15:01 +00:00

15 lines
450 B
Text

import Lean.Elab.Tactic.Basic
import Std.Tactic.BVDecide
/-! `replayConst` should be able to replay constants using additional axioms. -/
open Lean Lean.Meta Lean.Elab.Tactic in
elab "replay" ts:tacticSeq : tactic => do
let initEnv ← getEnv
evalTactic ts
let finalState ← saveState
setEnv $ ← initEnv.replayConsts initEnv finalState.term.meta.core.env
theorem test
(x y : BitVec 128) (h : y = x) : x = y := by
replay bv_decide