“ Metis:未使用的定理”在这种情况下意味着什么?

时间:2018-12-10 20:53:28

标签: isabelle formal-verification

我是伊莎贝尔(Isabelle)的新手,所以很抱歉此问题的形成方式不正确。

我正在尝试证明以下内容:

FontAngle

我的证明是:

newArray = Object.keys(dataObject).map(key => {
    return {operator:"sum", value: dataObject[key], property: key, type: typeof dataObject[key]};
});

这会触发警告:

record 
  Point =
    x :: nat
    y :: nat

definition
  cond :: "Point ⇒ Point ⇒ "
where
  "cond point1 point2 ≡ 
     abs (x point1 - x point2) = 1 ∨ abs (y point1 - y point2) = 1"

请有人能解释一下这是什么意思吗? 并且如果可能的话,请帮助我得出满足此条件的证明。

我还是伊莎贝尔(Isabelle)的新手,因此感谢所有评论。

1 个答案:

答案 0 :(得分:0)

我可以评论与您的​​问题相关的一些实际方面。我相信,警告是不言而喻的。通常,您可以删除未使用的定理,并且metis仍然能够证明您感兴趣的定理(请参见下面的代码清单中的cond_proof_metis)。

引理cond_proof可以通过展示两个满足引理条件的点来证明。我认为,这种方法可能比使用sledgehammer找到的默认证明更好。我在下面的代码清单中显示了如何在引理cond_proof_Isar中执行此操作。有更紧凑的方式展示示例。但是,鉴于您是Isabelle的新手,我遵循了对我来说似乎是最自然的方法。

我不确定您是否故意在证明中留下了命令sledgehammer。但是,在大多数情况下,这不是您希望执行的操作。 sledgehammer找到证明后,您可以从证明中删除命令sledgehammer

作为旁注,我建议您阅读Tobias Nipkow等人的“高阶逻辑的证明助手”一书和Ibelle / HOL的“具体语义学”一书中的一些示例和练习。 Tobias Nipkow和Gerwin Klein。前面提到的参考资料包含许多示例,这些示例与您要处理的问题非常相似。

不幸的是,我对sledgehammermetis的了解还不足以告诉您为什么使用sledgehammer的输出来证明定理时会产生警告。有关sledgehammermetis的更多信息,请参阅Jasmin Christian Blanchette撰写的“ Isabelle / HOL大锤用户指南”,该文件可在标准Isabelle文档中找到。当然,也可以在线(例如http://www.gilith.com/metis/)找到有关metis的更多信息。希望比我更有知识的人能够提供有关您查询的更多详细信息。

record 
  Point =
    x :: nat
    y :: nat

definition
  cond :: "Point ⇒ Point ⇒ bool"
where
  "cond point1 point2 ≡ 
     abs (x point1 - x point2) = 1 ∨ abs (y point1 - y point2) = 1"

(*Point_ext_def was part of the output produced by sledgehammer and is
listed as unused by metis. It can be removed with no effect on the
ability of metis to prove the result of interest.*)
lemma cond_proof_metis : "∃ point1 point2 . cond point1 point2 = True"
  by (metis (*Point_ext_def*) 
      abs_1 add_diff_cancel_left' cond_def of_nat_1_eq_iff select_convs(1))

lemma cond_proof_Isar : "∃ point1 point2 . cond point1 point2 = True"
proof - 
  define point1::Point where point1: "point1 ≡ ⦇x = 2, y = 0⦈"
  define point2::Point where point2: "point2 ≡ ⦇x = 1, y = 0⦈"
  from point1 point2 have "abs (x point1 - x point2) = 1" by simp
  then show ?thesis unfolding cond_def by auto
qed
相关问题