Isabelle 避免匹配(λ;x.x)
以理论为例 theory Scratch imports Main begin notepad begin fix P and f g h :: "int ⇒ int" assume prems: "P f" "P g" "P h" assume comp: "⋀ f g. P f ⟹ P g ⟹ P (λ x. f (g x))" have "P (λ x. f (g (h x)))" sorry end end 但这只是循环。原因是Isabelle 避免匹配(λ;x.x),isabelle,unification,Isabelle,Unification,以理论为例 theory Scratch imports Main begin notepad begin fix P and f g h :: "int ⇒ int" assume prems: "P f" "P g" "P h" assume comp: "⋀ f g. P f ⟹ P g ⟹ P (λ x. f (g x))" have "P (λ x. f (g (h x)))" sorry end end 但这只是循环。原因是comp与目标的一个可能统一是f
comp
与目标的一个可能统一是f=(λa.a)
和g=(λx.f(g(hx))
(可以通过使用apply(rule comp)
)看到,没有取得任何进展
我理解这是规则
代表的有效行为<代码>简介。然而,从实用的角度来看,我经常遇到简化或引入规则,这些规则在所有匹配的情况下都非常有用,除非它们匹配(λx.x)
是否有任何方式来声明<代码> COMP>代码>,这样伊莎贝尔的匹配器就不会考虑一个解决方案:<代码> f>代码>或<代码> g>代码> <代码>(λx?x)< /代码>?/p>
如果不是,技术和/或理论原因是什么?为什么不是这样?在Isabelle函数组合下关闭的属性库中有许多例子,例如,HOLCF和多元分析中的连续性。它们都有一个通用的组合规则,如
comp
,但comp
从未在规则应用程序中使用,因为它与%x匹配。x
。相反,只使用专门的实例,您可以使用THEN
属性获得这些实例。在您的示例中,这可能如下所示:
have "P (%x. f (g (h x)))"
by(rule prems prems[THEN comp])+
如果您只想寻找一个方法表达式来证明这一点,则可以利用该,
回溯,即
have "P (%x. f (g (h x)))"
by(rule prems|rule comp, rule prems)+
或者,您可以编写自己的rule
或intros
包装,丢弃结果序列的开头
have "P (%x. f (g (h x)))"
apply(tactic {*
REPEAT_FIRST (resolve_tac @{thms prems} ORELSE'
(fn i => snd o Seq.chop 1 o resolve_tac @{thms comp} i))
*})
HOLCF的连续性当然是我激励的例子。但是如果有很多例子,那么我的第二个问题就变得更加相关了:为什么我们不能找到一种不匹配
λx的方法呢。x
?或者,如果第一个结果的目标在前提中未被修改,那么为什么不能规则回溯呢。
have "P (%x. f (g (h x)))"
apply(tactic {*
REPEAT_FIRST (resolve_tac @{thms prems} ORELSE'
(fn i => snd o Seq.chop 1 o resolve_tac @{thms comp} i))
*})