Isabelle/HOL:访问另一语言环境中的解释
有一个Isabelle/HOL库,我想在它的基础上建立新的定义和证明。该库定义了locale2,我想在此基础上构建它。在locale2内部,有对locale1的解释 为了在单独的理论中扩展locale2,我定义locale3=locale2。然而,在locale3内部,我不知道如何访问locale2对locale1的解释。我该怎么做?(我这样做对吗?) 下面是一个MWE。这是我想要扩展的区域设置的库理论:Isabelle/HOL:访问另一语言环境中的解释,isabelle,Isabelle,有一个Isabelle/HOL库,我想在它的基础上建立新的定义和证明。该库定义了locale2,我想在此基础上构建它。在locale2内部,有对locale1的解释 为了在单独的理论中扩展locale2,我定义locale3=locale2。然而,在locale3内部,我不知道如何访问locale2对locale1的解释。我该怎么做?(我这样做对吗?) 下面是一个MWE。这是我想要扩展的区域设置的库理论: theory ExistingLibrary imports Main begin
theory ExistingLibrary
imports Main
begin
(* this is the locale with the function I want *)
locale locale1 = assumes True
begin
fun inc :: "nat ⇒ nat"
where "inc n = n + 1"
end
(* this is the locale that interprets the locale I want *)
locale locale2 = assumes True
begin
interpretation I: locale1
by unfold_locales auto
end
end
这是我的扩展理论。我的尝试位于底部,导致错误:
theory MyExtension
imports ExistingLibrary
begin
locale locale3 = locale2
begin
definition x :: nat
where "x = I.inc 7" (* Undefined constant: "I.inc" *)
end
end
上下文中的解释只持续到上下文结束。再次输入上下文时,您必须重复解释以使定义和定理可用:
locale 3 = locale2 begin
interpretation I: locale1 <proof>
locale 3=locale2 begin
解释一:本地1
因此,我建议将第一个解释步骤分为两步:
解释
命令本身可以通过(规则引理)证明子区域设置
而不是解释