Isabelle 使用获取会产生固定类型变量警告
关于如何证明这个Isabelle 使用获取会产生固定类型变量警告,isabelle,Isabelle,关于如何证明这个引理: lemma "dom (SOME b. dom b = A) = A" 作为第一个回答,p.Lammich说需要使用acquire: You have to show that there is such a beast b, ie, proof - obtain b where "dom b = A" ... thus ?thesis sledgehammer (*Should find a proof now, using the rules for
引理:
lemma "dom (SOME b. dom b = A) = A"
作为第一个回答,p.Lammich说需要使用acquire
:
You have to show that there is such a beast b, ie,
proof -
obtain b where "dom b = A" ...
thus ?thesis
sledgehammer (*Should find a proof now, using the rules for SOME, probably SomeI*)
在这里,我有一个主要问题,一个次要问题,我想知道p.Lammich说要做的事情,M.Eberl做的事情,和我得到的结果之间的一些差异
- Q1:我在使用
get
时,以及在使用by
语句证明get
时,在“b_uuuuu”中得到了警告引入的固定类型变量:“c”。我能摆脱这个警告吗
- Q2:是否有三个点的命令,
…
?我想它的意思是,“你的证明在这里。”然而,有时听起来作者也在说,“……因为,毕竟,这里的证明非常简单。”我还知道,有命令
,用于,通过这个,以及。
用于根据规则。此外,我认为,…
通常是一些简单的证明语句,我应该知道,但不知道
以下来源将显示警告。它可能是我应该修理的东西。源代码还显示了我如何帮助sledgehammer,也就是说我必须在它上面放一条exists语句
我把错误放在这是由于原理图变量引起的,以防有人对此感兴趣
(* I HELP SLEDGEHAMMER with an exists statement. I can delete the exists
statement after the `metis` proof is found.
The `?'c1` below causes an error, but `by` still proves the goal.
*)
lemma "dom (SOME b. dom b = A) = A"
proof-
have "? x. x = (SOME b. dom b = A)"
by(simp)
from this
obtain b where ob1: "dom b = A"
(*WARNING: Orange squiggly under `obtain`. Message: Introduced fixed type
variable(s): 'c in "b__".*)
by(metis (full_types) dom_const dom_restrict inf_top_left)
thus ?thesis
using[[show_types]]
(*Because of `show_types`, a schematic type variable `?'c1` will be part
of the proof command that `sledgehammer` provides in the output panel.*)
(*sledgehammer[minimize=smart,preplay_timeout=10,timeout=60,verbose=true,
isar_proofs=smart,provers="z3 spass remote_vampire"]*)
by(metis (lifting, full_types)
`!!thesis::bool.(!!b::'a => ?'c1 option. dom b = (A::'a set) ==> thesis)
==> thesis`
someI_ex)
(*ERROR: Illegal schematic type variable: ?'c1::type.
To get rid of the error, delete `?`, or use `ob1` as the fact.*)
qed
我的Q1和Q2与上述内容相关。作为我惊奇的一部分,有一个问题是由于原理图变量而导致的错误。我可能会将其报告为bug类型问题
在他的IsaUserList回复中,M.Eberl说他得到了以下大锤
关于获取
的证据。他说证据很慢,而且很难找到。对我来说大约2秒钟
by(metis (lifting, full_types)
dom_const dom_restrict inf_top.left_neutral someI_ex)
上述为我找到的关于的大锤的证明因此?论文只有4ms。回答了问题1
由于M.Eberl的评论,我做了一个值得尊敬的努力来找出如何在不使用access
的情况下获得证人。在这个过程中,我回答了我的主要问题
通过使用b::“'a=>'b option”
,而不是b
,我消除了关于将'c
作为类型变量引入的警告,如下所示:
lemma "dom (SOME b. dom b = A) = A"
proof-
obtain b :: "'a => 'b option" where "dom (b) = A"
by(metis (full_types) dom_const dom_restrict inf_top_left)
thus ?thesis
by(metis (lifting, full_types) exE_some)
qed
第二季度的答案
(更新140119)我终于在上找到了..
的Isar语法
术语…
——最后一个显式声明结果的参数(对于中缀应用程序,这是右侧)
字符串…
不是一个友好的搜索字符串。找到意义是开始阅读第一章的结果。我现在看到了isar-ref.pdf
的第1、2和6章是获得有关如何使用isar进行证明的一些帮助的关键章节。(结束更新。)
关于使用修复/假设作为获取
的替代方法而导致的错误
现在,我回到M.Eberl,告诉我不应该使用get
,这恰好是有益的。但是,它提出了一个重要的努力,试图找出如何使用语言,使皮德高兴。我在下面展示的最后一个来源是另一个例子,说明学习如何让PIDE快乐是多么麻烦。在很大程度上,它只是使用示例来尝试找出语法和命令的正确组合
p.Lammich说在他的回答中使用获取
。我还在中查找了get
的用法,其中讨论了与证人使用相关的用法
我读了一些其他的东西,我想这一切都告诉我,获取
对于固定具有特定属性的变量或常量至关重要
无论如何,我使用了def
创建了一个证人,因此我学到了一些新的东西:
declare[[show_sorts,show_brackets]]
lemma "dom (SOME b. dom b = A) = A"
proof-
def w == "(SOME b::('a => 'b option). dom b = A)"
hence "dom w = A"
by(metis (lifting, mono_tags) dom_const dom_restrict inf_top_left someI_ex)
print_facts
thus ?thesis
by(metis (lifting, full_types) dom_option_map exE_some)
qed
但是,我尝试使用一个fix/aspect
组合def
,其中假定def
是一个缩写,我得到了一个神秘且非常恼火的消息,“未能细化任何待定目标”,这让我想知道为什么我要使用这种语言
declare[[show_sorts,show_brackets]]
lemma "dom (SOME b. dom b = A) = A"
proof-
fix w assume w_def: "w == (SOME b::('a => 'b option). dom b = A)"
hence "dom w = A"
by(metis (lifting, mono_tags) dom_const dom_restrict inf_top_left someI_ex)
print_facts
thus ?thesis
oops
对于这两个校样,当光标位于print_facts
之前的行时,我在输出面板中看到的是完全相同的,除了def
校样显示校样(状态):步骤4
,而fix/asike
校样显示校样(状态):步骤5
。print\u facts
中的事实也相同
从搜索中,我知道“未能完善任何未决目标”是许多人痛苦的根源。在过去,我终于想出了摆脱它的诀窍,因为我在做什么,但这在这里没有意义,在那里也没有意义
更新140118\u 0054
L.Noschinski给出了以下微妙提示:
当您使用“修复”或“定义”来定义
变量,它们要么得到一般化(即转换为示意图)
(固定)或替换为其右侧(定义)
当一个块关闭时,执行一个显示
因此,对于证明的fix/假设形式,我将其部分放在括号中,出于某种原因,它以所需的方式导出事实:
lemma "dom (SOME b. dom b = A) = A"
proof-
{
fix w assume "w == (SOME b::('a => 'b option). dom b = A)"
hence "dom w = A"
by(metis (lifting, mono_tags) dom_const dom_restrict inf_top_left someI_ex)
}
thus ?thesis
by(metis (lifting, full_types) dom_option_map exE_some)
qed
我继续写一个let
形式的证明。如果没有看过M.Eberl的证明,我就不会知道使用原理图变量?w
lemma "dom (SOME b. dom b = A) = A"
proof-
let ?w = "(SOME b::('a => 'b option). dom b = A)"
have "dom ?w = A"
by(metis (lifting, mono_tags) dom_const dom_restrict inf_top_left someI_ex)
thus ?thesis
by(metis (lifting, full_types) dom_option_map exE_some)
qed
没有名为“…”There“.”的命令,如果我没记错的话,它与“根据假设”和“…”大致相同,后者与“根据规则”大致相同。然而,在Isar证明中,“…”可以用作前一个术语的缩写;具体是什么取决于上下文,细节可能可以在一些教程中找到。我想在这个上下文中,彼得的意思是“把你的证据放在这里”。事实上,我不会在这里使用“获取”,只是sh