我正在玩 Isabelle/HOL 教程中的一个示例,以更好地理解 Isar 和 Tactics 证明之间的对应关系。
这是一个有效的版本:
lemma rtrancl_converseD: "(x,y) ∈ (r ^-1 )^* ⟹ (y,x) ∈ r^* "
proof (induct y rule: rtrancl_induct)
case base
then show ?case ..
next case (step y z)
then have "(z, y) ∈ r" using rtrancl_converseD by simp
with `(y,x)∈ r^*` show "(z,x) ∈ r^*" using [[unify_trace_failure]]
apply (subgoal_tac "1=(1::nat)")
apply (rule converse_rtrancl_into_rtrancl)
apply simp_all
done
qed
我想实例化converse_rtrancl_into_rtrancl
哪些证明(?a, ?b) ∈ ?r ⟹ (?b, ?c) ∈ ?r^* ⟹ (?a, ?c) ∈ ?r^*
。
但是如果没有看似荒谬的apply (subgoal_tac "1=(1::nat)")
线,这个错误
Clash: r =/= Transitive_Closure.rtrancl
Failed to apply proof method⌂:
using this:
(y, x) ∈ r^*
(z, y) ∈ r
goal (1 subgoal):
1. (z, x) ∈ r^*
如果我完全实例化规则,apply (rule converse_rtrancl_into_rtrancl[of z y r x])
这将变为Clash: z__ =/= ya__
.
这给我留下了三个问题:为什么这个特定案例会破裂?我该如何解决?由于我无法真正理解 unify_trace_failure 消息想要告诉我什么,我如何才能弄清楚在这些情况下出了什么问题。