Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Isabelle/HOL:访问另一语言环境中的解释_Isabelle - Fatal编程技术网

Isabelle/HOL:访问另一语言环境中的解释

Isabelle/HOL:访问另一语言环境中的解释,isabelle,Isabelle,有一个Isabelle/HOL库,我想在它的基础上建立新的定义和证明。该库定义了locale2,我想在此基础上构建它。在locale2内部,有对locale1的解释 为了在单独的理论中扩展locale2,我定义locale3=locale2。然而,在locale3内部,我不知道如何访问locale2对locale1的解释。我该怎么做?(我这样做对吗?) 下面是一个MWE。这是我想要扩展的区域设置的库理论: theory ExistingLibrary imports Main begin

有一个Isabelle/HOL库,我想在它的基础上建立新的定义和证明。该库定义了locale2,我想在此基础上构建它。在locale2内部,有对locale1的解释

为了在单独的理论中扩展locale2,我定义locale3=locale2。然而,在locale3内部,我不知道如何访问locale2对locale1的解释。我该怎么做?(我这样做对吗?)

下面是一个MWE。这是我想要扩展的区域设置的库理论:

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
因此,我建议将第一个解释步骤分为两步:

  • 一个引理,其名称证明了解释步骤的目标
  • 解释
    命令本身可以通过(规则引理)证明
  • 如果希望在每次打开区域设置和每次解释区域设置时都进行解释,则最好使用
    子区域设置
    而不是
    解释