Trouble with extremely basic Isabelle/ISAR proofs

huangapple go评论53阅读模式
英文:

Trouble with extremely basic Isabelle/ISAR proofs

问题

我正在学习Isabelle/ISAR,我想尝试一些基本的逻辑证明。我遇到的核心问题是,即使我直接从指导手册中复制证明,我仍然会出现错误。我正在从以下pdf中复制:Isabelle 教程

这是一个非常基本的可以工作的证明:

lemma "A ⟶ A"
proof (rule impI)
  assume a: "A"
  show "A" by (rule a)
qed

然而,下面的证明尽管直接从文档幻灯片中复制,但会引发错误:

lemma "A ⟶ A"
proof
    assume "A"
    show "A" .
qed

错误截图

同样的情况也适用于这个证明:

lemma "A ⟶ A ∧ A"
proof
  assume "A"
  show "A ∧ A" ..
qed

错误截图

我不知道为什么直接从pdf中复制的证明不起作用。是因为我使用的Isabelle版本与pdf不同吗?还是我做错了什么?

英文:

I am just starting to learn Isabelle/ISAR, and I wanted to try some basic logic proofs. My core issue is that even when I copy proofs straight out of an instruction manual, I am still getting errors. I am copying from the following pdf: Isabelle Tutorial

Here is a very basic proof that works:

lemma "A ⟶ A"
proof (rule impI)
  assume a: "A"
  show "A" by(rule a)
qed

However, the following proof throws this error despite the fact that it is copied straight from a documentation slide.

lemma "A ⟶ A"
proof
    assume "A"
    show "A" .
qed

Error

The same is the case with this proof.

lemma "A ⟶ A ∧ A"
proof
  assume "A"
  show "A ∧ A" ..
qed

Error

I have no clue why proofs copied straight out of the pdf aren't working. Is it because I'm using a different version of Isabelle than the pdf? Or is there something I am doing wrong?

答案1

得分: 1

Please read the prog-prove instead of some old paper.

I don't know if the semantics changed since 2002 (which is possible), but show nowadays ignores the last fact. Instead you have to use thus or then show.

   show A
      (*no assumptions*)

while

   then show A
      (*we have the assumption "A"*)
英文:

Please read the prog-prove instead of some old paper.

I don't know if the semantics changed since 2002 (which is possible), but show nowadays ignores the last fact. Instead you have to use thus or then show.

   assume A
   show A
      (*no assumptions*)

while

   assume A
   then show A
      (*we have the assumption "A"*)

huangapple
  • 本文由 发表于 2023年5月18日 10:38:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76277383.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定