Isabelle的区域设置声明中的实例
我已经声明了一个特定的语言环境,它修复了多个问题,并且正在尝试为第一个语言环境的变体声明一个新的语言环境。这里是第一个区域设置:Isabelle的区域设置声明中的实例,isabelle,Isabelle,我已经声明了一个特定的语言环境,它修复了多个问题,并且正在尝试为第一个语言环境的变体声明一个新的语言环境。这里是第一个区域设置: locale presheaf = topology + Ring + fixes opcatopensets ::" ('a) PosetalCategory" and objectsmap :: "'a set ⇒ ('a, 'm) Ring_scheme" and restrictionsmap:: "('a set ×'a set) ⇒ ('a ⇒ 'a)
locale presheaf = topology + Ring +
fixes
opcatopensets ::" ('a) PosetalCategory" and
objectsmap :: "'a set ⇒ ('a, 'm) Ring_scheme" and
restrictionsmap:: "('a set ×'a set) ⇒ ('a ⇒ 'a)"
assumes
"opcatopensets ≡ ⦇ Obj = {x. x ∈ T} , Mor = {(x,y)| x y. (x,y) ∈ revpo} ,
Dom = psheafdom , Cod = psheafcod , Id = psheafid , Comp = psheafcomp ⦈" and
"∀y w. w ≠ y ⟶ (psheafcomp (x,y) (w,z) = undefined)" and
"∀x. x ∉ T ⟶ (objectsmap x = undefined)" and
"∀x y.(restrictionsmap (x,y)) ∈ rHom (objectsmap x) (objectsmap y)" and
"∀ x y . (restrictionsmap (x,x) y = y) " and
"∀ x y z . ( (restrictionsmap (y,z))∘(restrictionsmap (x,y)) = restrictionsmap(x,z) )"
在这个声明的末尾,我得到了以下输出:
locale presheaf =
fixes T :: "'a set set"
and R :: "('b, 'c) Ring_scheme"
and opcatopensets :: "'a PosetalCategory"
and objectsmap :: "'a set ⇒ ('a, 'm) Ring_scheme"
and restrictionsmap :: "'a set × 'a set ⇒ 'a ⇒ 'a"
assumes "presheaf T R opcatopensets objectsmap restrictionsmap"
因此,我想我可以从最后一行提取我需要的内容,以便定义一个新的区域设置,其中包含两个区域设置“presheaf”实例。这就是我所尝试的:
locale sheafmorphism =
F: presheaf T R opcatopensets F restrictionsmap + G: presheaf T R opcatopensets
G restrictionsmap
for F and G +
fixes morphism :: "'a set ⇒ ('a ⇒ 'a)"
assumes (things)
简言之,我想修正两个预拉伸F和G,然后修正这个参数“态射”,并假设涉及“态射”以及F和G的“限制映射”和“对象映射”的情况。我的这一尝试导致:
表达式中的非法自由变量:“T”、“R”、“opcatopensets”,
“限制地图”
我想我不明白当您想要实例化的区域设置修复了不止一件事情时,如何做到这一点。导致此错误的原因是什么?我该如何做?您可以轻松地将多个区域设置实例组合成一个新实例,但通常必须重命名区域设置的参数,并使用
for
相应地声明它们。在代码中,您仅将参数objectsmap
分别重命名为F
和G
,并添加前缀F
和G
,以引用这两个实例。但是,其他参数T
、R
、opcatopensets
和restrictionsmap
尚未重命名,并且在区域设置声明的for
子句中缺失。这就是错误消息的原因。因此,您应该将它们添加到for
子句中,它应该可以工作。但是,区域设置的两个实例将使用相同的T
、R
、opcatopensets
和restrictionsmap
。如果这不是您想要的,那么您也应该重命名它们
例如,下面的声明
locale sheafmorphism =
F: presheaf T1 R1 opcatopensets1 F restrictionsmap1 +
G: presheaf T2 R2 opcatopensets2 G restrictionsmap2
for T1 R1 opcatopensets1 F restrictionsmap1
T2 R2 opcatopensets2 G restrictionsmap2 +
fixes morphism :: "'a set ⇒ ('a ⇒ 'a)"
assumes ...
重命名两个实例的所有参数。与此相反,以下仅将变形重命名为F
和G
locale sheafmorphism =
F: presheaf T R opcatopensets F restrictionsmap +
G: presheaf T R opcatopensets G restrictionsmap
for T R opcatopensets F G restrictionsmap +
fixes morphism :: "'a set ⇒ ('a ⇒ 'a)"
assumes ...
谢谢你。如何重命名“for”声明中的参数?根据你所说的,我试着写“locale sheafmorphism=F:presheaf T R opt opensets F restrictionsmap+G:presheaf T R opt opensets G restrictionsmap for T R opt opensets F restrictionsmap和G+(…)”,这似乎修复了这个错误,但如果能提到“限制地图”的“F版”和“G版”,那就太好了。我在这篇文章中添加了两个重命名的例子。您可以在“文档”面板中提供的有关区域设置的教程中找到更多解释。