diff -r a5f53d9d2b60 -r f8537d69f514 doc-src/TutorialI/CTL/CTL.thy --- a/doc-src/TutorialI/CTL/CTL.thy Thu May 29 13:27:13 2008 +0200 +++ b/doc-src/TutorialI/CTL/CTL.thy Thu May 29 22:45:33 2008 +0200 @@ -24,8 +24,8 @@ in HOL: it is simply a function from @{typ nat} to @{typ state}. *}; -constdefs Paths :: "state \ (nat \ state)set" - "Paths s \ {p. s = p 0 \ (\i. (p i, p(i+1)) \ M)}"; +definition Paths :: "state \ (nat \ state)set" where +"Paths s \ {p. s = p 0 \ (\i. (p i, p(i+1)) \ M)}" text{*\noindent This definition allows a succinct statement of the semantics of @{const AF}: @@ -35,37 +35,34 @@ a new datatype and a new function.} *}; (*<*) -consts valid :: "state \ formula \ bool" ("(_ \ _)" [80,80] 80); - -primrec -"s \ Atom a = (a \ L s)" -"s \ Neg f = (~(s \ f))" -"s \ And f g = (s \ f \ s \ g)" -"s \ AX f = (\t. (s,t) \ M \ t \ f)" -"s \ EF f = (\t. (s,t) \ M\<^sup>* \ t \ f)" +primrec valid :: "state \ formula \ bool" ("(_ \ _)" [80,80] 80) where +"s \ Atom a = (a \ L s)" | +"s \ Neg f = (~(s \ f))" | +"s \ And f g = (s \ f \ s \ g)" | +"s \ AX f = (\t. (s,t) \ M \ t \ f)" | +"s \ EF f = (\t. (s,t) \ M\<^sup>* \ t \ f)" | (*>*) -"s \ AF f = (\p \ Paths s. \i. p i \ f)"; +"s \ AF f = (\p \ Paths s. \i. p i \ f)" text{*\noindent Model checking @{const AF} involves a function which is just complicated enough to warrant a separate definition: *}; -constdefs af :: "state set \ state set \ state set" - "af A T \ A \ {s. \t. (s, t) \ M \ t \ T}"; +definition af :: "state set \ state set \ state set" where +"af A T \ A \ {s. \t. (s, t) \ M \ t \ T}" text{*\noindent Now we define @{term "mc(AF f)"} as the least set @{term T} that includes @{term"mc f"} and all states all of whose direct successors are in @{term T}: *}; (*<*) -consts mc :: "formula \ state set"; -primrec -"mc(Atom a) = {s. a \ L s}" -"mc(Neg f) = -mc f" -"mc(And f g) = mc f \ mc g" -"mc(AX f) = {s. \t. (s,t) \ M \ t \ mc f}" -"mc(EF f) = lfp(\T. mc f \ M\ `` T)"(*>*) +primrec mc :: "formula \ state set" where +"mc(Atom a) = {s. a \ L s}" | +"mc(Neg f) = -mc f" | +"mc(And f g) = mc f \ mc g" | +"mc(AX f) = {s. \t. (s,t) \ M \ t \ mc f}" | +"mc(EF f) = lfp(\T. mc f \ M\ `` T)"|(*>*) "mc(AF f) = lfp(af(mc f))"; text{*\noindent @@ -106,8 +103,7 @@ with the easy one: *}; -theorem AF_lemma1: - "lfp(af A) \ {s. \p \ Paths s. \i. p i \ A}"; +theorem AF_lemma1: "lfp(af A) \ {s. \p \ Paths s. \i. p i \ A}" txt{*\noindent In contrast to the analogous proof for @{const EF}, and just @@ -165,10 +161,9 @@ path is parameterized by a predicate @{term Q} that should hold along the path: *}; -consts path :: "state \ (state \ bool) \ (nat \ state)"; -primrec -"path s Q 0 = s" -"path s Q (Suc n) = (SOME t. (path s Q n,t) \ M \ Q t)"; +primrec path :: "state \ (state \ bool) \ (nat \ state)" where +"path s Q 0 = s" | +"path s Q (Suc n) = (SOME t. (path s Q n,t) \ M \ Q t)" text{*\noindent Element @{term"n+1::nat"} on this path is some arbitrary successor