text‹ We formalize basic concepts of Computational Tree Logic (CTL) 🍋‹"McMillan-PhDThesis"›within the simply-typed set theory of HOL. By using the common technique of ``shallow embedding'', a CTL formula is identified with the corresponding set of states where it holds. Consequently, CTL operations such as negation, conjunction, disjunction simply become complement, intersection, union of sets. We only require a separate operation for implication, as point-wise inclusion is usually not encountered in plain set-theory. ›
definition imp :: "'a ctl ==> 'a ctl ==> 'a ctl" (infixr‹→› 75) where"p → q = - p ∪ q"
lemma [intro!]: "p ∩ p → q ⊆ q"unfolding imp_def by auto lemma [intro!]: "p ⊆ (q → p)"unfolding imp_def by rule
text‹ 🪙 The CTL path operators are more interesting; they are based on an arbitrary, but fixed model ‹M›, which is simply a transition relation over states 🍋‹'a›. ›
axiomatizationM :: "('a × 'a) set"
text‹ The operators ‹🪙E🪙X›,‹🪙E🪙F›, ‹🪙E🪙G› are taken as primitives, while ‹🪙A🪙X›, ‹🪙A🪙F›,‹🪙A🪙G› are defined as derived ones. The formula ‹🪙E🪙X p› holds in a state ‹s›, iff there is a successor state ‹s'› (with respect to the model ‹M›), such that ‹p› holds in ‹s'›. The formula ‹🪙E🪙F p› holds in a state ‹s›, iff there is a path in ‹M›, starting from ‹s›, such that there exists a state ‹s'›on the path, such that ‹p› holds in ‹s'›. The formula ‹🪙E🪙G p› holds in a state ‹s›, iff there is a path, starting from ‹s›, such that for all states ‹s'›on the path, ‹p› holds in ‹s'›. It is easy to see that ‹🪙E🪙F p› 🍋‹"McMillan-PhDThesis"›. ›
definition EX (‹🪙E🪙X _› [80] 90) where [simp]: "🪙E🪙X p = {s. ∃s'. (s, s') ∈M∧ s' ∈ p}"
definition EF (‹🪙E🪙F _› [80] 90) where [simp]: "🪙E🪙F p = lfp (λs. p ∪🪙E🪙X s)"
definition EG (‹🪙E🪙G _› [80] 90) where [simp]: "🪙E🪙G p = gfp (λs. p ∩🪙E🪙X s)"
text‹ ‹🪙A🪙X›,‹🪙A🪙F› and ‹🪙A🪙G› are now defined dually in terms of ‹🪙E🪙X›, ‹🪙E🪙F›and ‹🪙E🪙G›. ›
definition AX (‹🪙A🪙X _› [80] 90) where [simp]: "🪙A🪙X p = - 🪙E🪙X - p" definition AF (‹🪙A🪙F _› [80] 90) where [simp]: "🪙A🪙F p = - 🪙E🪙G - p" definition AG (‹🪙A🪙G _› [80] 90) where [simp]: "🪙A🪙G p = - 🪙E🪙F - p"
subsection‹Basic fixed point properties›
text‹ First of all, we use the de-Morgan property of fixed points. ›
lemma lfp_gfp: "lfp f = - gfp (λs::'a set. - (f (- s)))" proof show"lfp f ⊆ - gfp (λs. - f (- s))" proof show"x ∈ - gfp (λs. - f (- s))"if l: "x ∈ lfp f"for x proof assume"x ∈ gfp (λs. - f (- s))" thenobtain u where"x ∈ u"and"u ⊆ - f (- u)" by (auto simp add: gfp_def) thenhave"f (- u) ⊆ - u"by auto thenhave"lfp f ⊆ - u"by (rule lfp_lowerbound) from l and this have"x ∉ u"by auto with‹x ∈ u›show False by contradiction qed qed show"- gfp (λs. - f (- s)) ⊆ lfp f" proof (rule lfp_greatest) fix u assume"f u ⊆ u" thenhave"- u ⊆ - f u"by auto thenhave"- u ⊆ - f (- (- u))"by simp thenhave"- u ⊆ gfp (λs. - f (- s))"by (rule gfp_upperbound) thenshow"- gfp (λs. - f (- s)) ⊆ u"by auto qed qed
lemma lfp_gfp': "- lfp f = gfp (λs::'a set. - (f (- s)))" by (simp add: lfp_gfp)
lemma gfp_lfp': "- gfp f = lfp (λs::'a set. - (f (- s)))" by (simp add: lfp_gfp)
text‹ In order to give dual fixed point representations of 🍋‹🪙A🪙F p›and 🍋‹🪙A🪙G p›: ›
lemma AF_lfp: "🪙A🪙F p = lfp (λs. p ∪🪙A🪙X s)" by (simp add: lfp_gfp)
lemma AG_gfp: "🪙A🪙G p = gfp (λs. p ∩🪙A🪙X s)" by (simp add: lfp_gfp)
lemma EF_fp: "🪙E🪙F p = p ∪🪙E🪙X 🪙E🪙F p" proof - have"mono (λs. p ∪🪙E🪙X s)"by rule auto thenshow ?thesis by (simp only: EF_def) (rule lfp_unfold) qed
lemma AF_fp: "🪙A🪙F p = p ∪🪙A🪙X 🪙A🪙F p" proof - have"mono (λs. p ∪🪙A🪙X s)"by rule auto thenshow ?thesis by (simp only: AF_lfp) (rule lfp_unfold) qed
lemma EG_fp: "🪙E🪙G p = p ∩🪙E🪙X 🪙E🪙G p" proof - have"mono (λs. p ∩🪙E🪙X s)"by rule auto thenshow ?thesis by (simp only: EG_def) (rule gfp_unfold) qed
text‹ From the greatest fixed point definition of 🍋‹🪙A🪙G p›, we derive as a consequence of the Knaster-Tarski theorem on the one hand that 🍋‹🪙A🪙G p›is a fixed point of the monotonic function 🍋‹λs. p ∩🪙A🪙X s›. ›
lemma AG_fp: "🪙A🪙G p = p ∩🪙A🪙X 🪙A🪙G p" proof - have"mono (λs. p ∩🪙A🪙X s)"by rule auto thenshow ?thesis by (simp only: AG_gfp) (rule gfp_unfold) qed
text‹ This fact may be split up into two inequalities (merely using transitivity of ‹⊆›, which is an instance of the overloaded ‹≤› in Isabelle/HOL). ›
lemma AG_fp_1: "🪙A🪙G p ⊆ p" proof - note AG_fp alsohave"p ∩🪙A🪙X 🪙A🪙G p ⊆ p"by auto finallyshow ?thesis . qed
lemma AG_fp_2: "🪙A🪙G p ⊆🪙A🪙X 🪙A🪙G p" proof - note AG_fp alsohave"p ∩🪙A🪙X 🪙A🪙G p ⊆🪙A🪙X 🪙A🪙G p"by auto finallyshow ?thesis . qed
text‹ On the other hand, we have from the Knaster-Tarski fixed point theorem that any other post-fixed point of 🍋‹λs. p ∩🪙A🪙X s›is smaller than 🍋‹🪙A🪙G p›. A post-fixed point is a set of states ‹q› such that 🍋‹q ⊆ p ∩??A🪙X q›. This leads to the following co-induction principle for 🍋‹🪙A🪙G p›. ›
lemma AG_I: "q ⊆ p ∩🪙A🪙X q ==> q ⊆🪙A🪙G p" by (simp only: AG_gfp) (rule gfp_upperbound)
subsection‹The tree induction principle \label{sec:calc-ctl-tree-induct}›
text‹ With the most basic facts available, we are now able to establish a few more interesting results, leading to the 🪙‹tree induction›principle for ‹🪙A🪙G› (see below). We will use some elementary monotonicity and distributivity rules. ›
lemma AX_int: "🪙A🪙X (p ∩ q) = 🪙A🪙X p ∩🪙A🪙X q"by auto lemma AX_mono: "p ⊆ q ==>🪙A🪙X p ⊆🪙A🪙X q"by auto lemma AG_mono: "p ⊆ q ==>🪙A🪙G p ⊆🪙A🪙G q" by (simp only: AG_gfp, rule gfp_mono) auto
text‹ The formula 🍋‹AG p›implies 🍋‹AX p› (we use substitution of ‹⊆›with monotonicity). ›
lemma AG_AX: "🪙A🪙G p ⊆🪙A🪙X p" proof - have"🪙A🪙G p ⊆🪙A🪙X 🪙A🪙G p"by (rule AG_fp_2) alsohave"🪙A🪙G p ⊆ p"by (rule AG_fp_1) moreovernote AX_mono finallyshow ?thesis . qed
text‹ Furthermore we show idempotency of the ‹🪙A🪙G›operator. The proof is a good example of how accumulated facts may get used to feed a single rule step. ›
lemma AG_AG: "🪙A🪙G 🪙A🪙G p = 🪙A🪙G p" proof show"🪙A🪙G 🪙A🪙G p ⊆🪙A🪙G p"by (rule AG_fp_1) next show"🪙A🪙G p ⊆🪙A🪙G 🪙A🪙G p" proof (rule AG_I) have"🪙A🪙G p ⊆🪙A🪙G p" .. moreoverhave"🪙A🪙G p ⊆🪙A🪙X 🪙A🪙G p"by (rule AG_fp_2) ultimatelyshow"🪙A🪙G p ⊆🪙A🪙G p ∩🪙A🪙X 🪙A🪙G p" .. qed qed
text‹ 🪙 We now give an alternative characterization of the ‹🪙A🪙G›operator, which describes the ‹🪙A🪙G›operator in an ``operational'' way by tree induction: In a state holds 🍋‹AG p›iff in that state holds ‹p›, and in all reachable states ‹s›follows from the fact that ‹p› holds in ‹s›, that ‹p› also holds in all successor states of ‹s›. We use the co-induction principle @{thm [source] AG_I} to establish this in a purely algebraic manner. ›
theorem AG_induct: "p ∩🪙A🪙G (p →🪙A🪙X p) = 🪙A🪙G p" proof show"p ∩🪙A🪙G (p →🪙A🪙X p) ⊆🪙A🪙G p" (is"?lhs ⊆ _") proof (rule AG_I) show"?lhs ⊆ p ∩🪙A🪙X ?lhs" proof show"?lhs ⊆ p" .. show"?lhs ⊆🪙A🪙X ?lhs" proof -
{ have"🪙A🪙G (p →🪙A🪙X p) ⊆ p →🪙A🪙X p"by (rule AG_fp_1) alsohave"p ∩ p →🪙A🪙X p ⊆🪙A🪙X p" .. finallyhave"?lhs ⊆🪙A🪙X p"by auto
} moreover
{ have"p ∩🪙A🪙G (p →🪙A🪙X p) ⊆🪙A🪙G (p →🪙A🪙X p)" .. alsohave"…⊆🪙A🪙X …"by (rule AG_fp_2) finallyhave"?lhs ⊆🪙A🪙X 🪙A🪙G (p →🪙A🪙X p)" .
} ultimatelyhave"?lhs ⊆🪙A🪙X p ∩🪙A🪙X 🪙A🪙G (p →🪙A🪙X p)" .. alsohave"… = 🪙A🪙X ?lhs"by (simp only: AX_int) finallyshow ?thesis . qed qed qed next show"🪙A🪙G p ⊆ p ∩🪙A🪙G (p →🪙A🪙X p)" proof show"🪙A🪙G p ⊆ p"by (rule AG_fp_1) show"🪙A🪙G p ⊆🪙A🪙G (p →🪙A🪙X p)" proof - have"🪙A🪙G p = 🪙A🪙G 🪙A🪙G p"by (simp only: AG_AG) alsohave"🪙A🪙G p ⊆🪙A🪙X p"by (rule AG_AX) moreovernote AG_mono alsohave"🪙A🪙X p ⊆ (p →🪙A🪙X p)" .. moreovernote AG_mono finallyshow ?thesis . qed qed qed
subsection‹An application of tree induction \label{sec:calc-ctl-commute}›
text‹ Further interesting properties of CTL expressions may be demonstrated with the help of tree induction; here we show that ‹🪙A🪙X›and ‹🪙A🪙G› commute. ›
theorem AG_AX_commute: "🪙A🪙G 🪙A🪙X p = 🪙A🪙X 🪙A🪙G p" proof - have"🪙A🪙G 🪙A🪙X p = 🪙A🪙X p ∩🪙A🪙X 🪙A🪙G 🪙A🪙X p"by (rule AG_fp) alsohave"… = 🪙A🪙X (p ∩🪙A🪙G 🪙A🪙X p)"by (simp only: AX_int) alsohave"p ∩🪙A🪙G 🪙A🪙X p = 🪙A🪙G p" (is"?lhs = _") proof have"🪙A🪙X p ⊆ p →🪙A🪙X p" .. alsohave"p ∩🪙A🪙G (p →🪙A🪙X p) = 🪙A🪙G p"by (rule AG_induct) alsonote Int_mono AG_mono ultimatelyshow"?lhs ⊆🪙A🪙G p"by fast next have"🪙A🪙G p ⊆ p"by (rule AG_fp_1) moreover
{ have"🪙A🪙G p = 🪙A🪙G 🪙A🪙G p"by (simp only: AG_AG) alsohave"🪙A🪙G p ⊆🪙A🪙X p"by (rule AG_AX) alsonote AG_mono ultimatelyhave"🪙A🪙G p ⊆🪙A🪙G 🪙A🪙X p" .
} ultimatelyshow"🪙A🪙G p ⊆ ?lhs" .. qed finallyshow ?thesis . qed
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-04-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.