如何在Isablle中标记的过渡系统中证明这种引理

发布于 2025-01-26 11:31:35 字数 700 浏览 0 评论 0原文

我已经定义了下面的浅过渡系统,以及可以判断列表是否可以达到的函数。


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


primrec LTS_is_reachable :: "('q, 'a) LTS \<Rightarrow> 'q \<Rightarrow> 'a list \<Rightarrow> 'q \<Rightarrow> bool" where
   "LTS_is_reachable \<Delta> q [] q' = (q = q')"|
"LTS_is_reachable \<Delta> q (a # w) q' =
      (\<exists>q'' \<sigma>. a \<in> \<sigma> \<and> (q, \<sigma>, q'') \<in> \<Delta> \<and> LTS_is_reachable \<Delta> q'' w q')"

但是问题是我不知道如何在引理以下证明。

lemma "LTS_is_reachable {([], {v}, [v])} [] x [v] \<Longrightarrow> x = [v]"

I have defined such a labled transition system as below, and a function to judge given a list whether it could be reached.


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


primrec LTS_is_reachable :: "('q, 'a) LTS \<Rightarrow> 'q \<Rightarrow> 'a list \<Rightarrow> 'q \<Rightarrow> bool" where
   "LTS_is_reachable \<Delta> q [] q' = (q = q')"|
"LTS_is_reachable \<Delta> q (a # w) q' =
      (\<exists>q'' \<sigma>. a \<in> \<sigma> \<and> (q, \<sigma>, q'') \<in> \<Delta> \<and> LTS_is_reachable \<Delta> q'' w q')"

But the problem is that i don't know how to prove below lemma.

lemma "LTS_is_reachable {([], {v}, [v])} [] x [v] \<Longrightarrow> x = [v]"

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

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

发布评论

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

评论(1

猫九 2025-02-02 11:31:35

为了使用定义,您必须在x上对案例进行区分,以使定义模式显示:

lemma "LTS_is_reachable {([], {v}, [v])} [] x [v] ⟹ x = [v]"
  apply (cases x; cases ‹tl x›)
   apply auto
  done

编辑:作为附带说明,首先定义一个函数,返回集合对我来说更自然在所有可触及的状态中,然后检查v是否与集合。我希望这个版本更容易推理。

In order to use the definition you have to make a case distinction on x to make the definition patterns appear:

lemma "LTS_is_reachable {([], {v}, [v])} [] x [v] ⟹ x = [v]"
  apply (cases x; cases ‹tl x›)
   apply auto
  done

EDIT: as a side remark, it feels more natural to me to first define a function returning the set of all reachable states and then check if v is with the set. I expect this version to be easier to reason with.

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