空的三角洲引理证明在伊莎贝尔(Isabelle)

发布于 2025-02-10 02:29:54 字数 899 浏览 1 评论 0原文

我已经定义了下文的归纳谓词。在这里,我想证明一个称为emptydelta1的显而易见的引理。但是这里似乎存在一些问题。

type_synonym ('q,'a) LTS = "('q * 'a set * 'q) set"

inductive LTS_is_reachable :: "('q, 'a) LTS ⇒  ('q * 'q) set ⇒ 'q ⇒ 'a list ⇒ 'q ⇒ bool" where
   LTS_Empty[intro!]:"LTS_is_reachable Δ Δ' q [] q"|
   LTS_Step1:"(q, q'') ∈ Δ' ∧ LTS_is_reachable Δ Δ' q'' l q' ⟹ LTS_is_reachable Δ Δ' q l q'" |
   LTS_Step2[intro!]:"a  ∈ σ ∧ (q, σ, q'') ∈ Δ ∧ LTS_is_reachable Δ Δ' q'' w q' ⟹ LTS_is_reachable Δ Δ' q (a # w) q'"

引理是

lemma "LTS_is_reachable {} Δ' p x q ⟹ x = []"
proof(induction rule:LTS_is_reachable.cases)
case (LTS_Empty Δ Δ' q)
then show ?case by auto
next
  case (LTS_Step1 q q'' Δ' Δ l q')
then show ?case apply simp sorry
next
case (LTS_Step2 a σ q q'' Δ Δ' w q')
then show ?case by auto
qed

想法:BeaCause来自Delta1的列表中的元素,因此当Delta1为空时,列表的结果必须为空。

任何帮助将不胜感激!

I have defined an inductive predicate as below. And here i want to prove an obvious lemma which called emptyDelta1. But it seems that there exists some questions here.

type_synonym ('q,'a) LTS = "('q * 'a set * 'q) set"

inductive LTS_is_reachable :: "('q, 'a) LTS ⇒  ('q * 'q) set ⇒ 'q ⇒ 'a list ⇒ 'q ⇒ bool" where
   LTS_Empty[intro!]:"LTS_is_reachable Δ Δ' q [] q"|
   LTS_Step1:"(q, q'') ∈ Δ' ∧ LTS_is_reachable Δ Δ' q'' l q' ⟹ LTS_is_reachable Δ Δ' q l q'" |
   LTS_Step2[intro!]:"a  ∈ σ ∧ (q, σ, q'') ∈ Δ ∧ LTS_is_reachable Δ Δ' q'' w q' ⟹ LTS_is_reachable Δ Δ' q (a # w) q'"

The lemma is

lemma "LTS_is_reachable {} Δ' p x q ⟹ x = []"
proof(induction rule:LTS_is_reachable.cases)
case (LTS_Empty Δ Δ' q)
then show ?case by auto
next
  case (LTS_Step1 q q'' Δ' Δ l q')
then show ?case apply simp sorry
next
case (LTS_Step2 a σ q q'' Δ Δ' w q')
then show ?case by auto
qed

Idea: beacause the element in list which comes from the Delta1, so that when the delta1 is empty, that the result of list must be empty.

Any helps will be appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

惯饮孤独 2025-02-17 02:29:54

首先,您应该对您的定义进行一些改进,以lts_is_reachable

  1. 请注意,参数ΔΔ'是固定参数(即它们不会更改)。因此,您应该通过使用子句的encuctive定义的子句来提示isabelle。这样,伊莎贝尔能够生成更简单的归纳规则。

  2. 您应该尝试避免使用进行复合假设,而是使用或更好的是,ISAR构造如果 和>和。这样,您允许更简单的证据和更好的自动化。

也就是说,您改进的lts_is_reachable的定义如下:

inductive LTS_is_reachable :: "('q, 'a) LTS ⇒  ('q * 'q) set ⇒ 'q ⇒ 'a list ⇒ 'q ⇒ bool" for Δ and Δ' where
  LTS_Empty[intro!]: "LTS_is_reachable Δ Δ' q [] q" |
  LTS_Step1: "LTS_is_reachable Δ Δ' q l q'" if "(q, q'') ∈ Δ'" and "LTS_is_reachable Δ Δ' q'' l q'" |
  LTS_Step2[intro!]: "LTS_is_reachable Δ Δ' q (a # w) q'" if "a ∈ σ" and "(q, σ, q'') ∈ Δ" and "LTS_is_reachable Δ Δ' q'' w q'"

关于引理的证明,您应使用lts_is_reachable.indable.induct.induct而不是lts_is_reachable.cases作为通过计算诱导进行证明的规则。这样,您可以轻松地证明自己的引理如下:

lemma "LTS_is_reachable {} Δ' p x q ⟹ x = []"
proof (induction rule: LTS_is_reachable.induct)
  case (LTS_Empty q)
  then show ?case by simp
next
  case (LTS_Step1 q q'' l q')
  then show ?case by simp
next
  case (LTS_Step2 a σ q q'' w q')
  then show ?case by simp 
qed

或者,较短,如下所示:

lemma "LTS_is_reachable {} Δ' p x q ⟹ x = []"
  by (induction rule: LTS_is_reachable.induct) simp_all

希望这会有所帮助。

Firstly, there are a couple of improvements that should be made to your definition of LTS_is_reachable:

  1. Note that the parameters Δ and Δ' are fixed parameters (i.e., they do not change). Thus, you should hint Isabelle by using the for clause of the inductive definition. This way, Isabelle is able to generate a simpler induction rule.

  2. You should try to avoid for compound assumptions and instead use or, even better, the Isar constructs if and and. This way, you allow for simpler proofs and better automation.

That is, your improved definition of LTS_is_reachable is the following:

inductive LTS_is_reachable :: "('q, 'a) LTS ⇒  ('q * 'q) set ⇒ 'q ⇒ 'a list ⇒ 'q ⇒ bool" for Δ and Δ' where
  LTS_Empty[intro!]: "LTS_is_reachable Δ Δ' q [] q" |
  LTS_Step1: "LTS_is_reachable Δ Δ' q l q'" if "(q, q'') ∈ Δ'" and "LTS_is_reachable Δ Δ' q'' l q'" |
  LTS_Step2[intro!]: "LTS_is_reachable Δ Δ' q (a # w) q'" if "a ∈ σ" and "(q, σ, q'') ∈ Δ" and "LTS_is_reachable Δ Δ' q'' w q'"

Regarding the proof of your lemma, you should use LTS_is_reachable.induct instead of LTS_is_reachable.cases as the rule for a proof by computation induction. This way, you can easily prove your lemma as follows:

lemma "LTS_is_reachable {} Δ' p x q ⟹ x = []"
proof (induction rule: LTS_is_reachable.induct)
  case (LTS_Empty q)
  then show ?case by simp
next
  case (LTS_Step1 q q'' l q')
  then show ?case by simp
next
  case (LTS_Step2 a σ q q'' w q')
  then show ?case by simp 
qed

Or, much shorter, as follows:

lemma "LTS_is_reachable {} Δ' p x q ⟹ x = []"
  by (induction rule: LTS_is_reachable.induct) simp_all

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文