fix(builtin/tactic): more meaningful error message when skip tactic is used in a full proof
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
57982135d9
commit
4317f67bd2
3 changed files with 22 additions and 5 deletions
|
@ -31,15 +31,15 @@ tactic_macro("simp", { macro_arg.Ids },
|
|||
-- This tactic is useful for momentarily ignoring/skipping a "hole" in a big proof.
|
||||
-- Remark: the kernel will not accept a proof built using this tactic.
|
||||
skip_tac = tactic(function (env, ios, s)
|
||||
local gs = s:goals()
|
||||
local pb = s:proof_builder()
|
||||
local trivial = mk_constant("trivial")
|
||||
local new_pb =
|
||||
local gs = s:goals()
|
||||
local pb = s:proof_builder()
|
||||
local buggy_pr = mk_constant("invalid proof built using skip tactic")
|
||||
local new_pb =
|
||||
function(m, a)
|
||||
-- We provide a "fake/incorrect" proof for all goals in gs
|
||||
local new_m = proof_map(m) -- Copy proof map m
|
||||
for n, g in gs:pairs() do
|
||||
new_m:insert(n, trivial)
|
||||
new_m:insert(n, buggy_pr)
|
||||
end
|
||||
return pb(new_m, a)
|
||||
end
|
||||
|
|
12
tests/lean/jbug1.lean
Normal file
12
tests/lean/jbug1.lean
Normal file
|
@ -0,0 +1,12 @@
|
|||
import macros
|
||||
import tactic
|
||||
|
||||
theorem le_iff (a b : Nat) : a ≤ b ↔ a < b ∨ a = b
|
||||
:=
|
||||
iff_intro (
|
||||
assume H : a ≤ b,
|
||||
show a < b ∨ a = b, by skip
|
||||
)(
|
||||
assume H : a < b ∨ a = b,
|
||||
show a ≤ b, by skip
|
||||
)
|
5
tests/lean/jbug1.lean.expected.out
Normal file
5
tests/lean/jbug1.lean.expected.out
Normal file
|
@ -0,0 +1,5 @@
|
|||
Set: pp::colors
|
||||
Set: pp::unicode
|
||||
Imported 'macros'
|
||||
Imported 'tactic'
|
||||
jbug1.lean:4:0: error: unknown object 'invalid proof built using skip tactic'
|
Loading…
Reference in a new issue