equal
deleted
inserted
replaced
25 "mk_program(init, acts, allowed) == |
25 "mk_program(init, acts, allowed) == |
26 <init \<inter> state, cons(id(state), acts \<inter> Pow(state*state)), |
26 <init \<inter> state, cons(id(state), acts \<inter> Pow(state*state)), |
27 cons(id(state), allowed \<inter> Pow(state*state))>" |
27 cons(id(state), allowed \<inter> Pow(state*state))>" |
28 |
28 |
29 definition |
29 definition |
30 SKIP :: i ("\<bottom>") where |
30 SKIP :: i (\<open>\<bottom>\<close>) where |
31 "SKIP == mk_program(state, 0, Pow(state*state))" |
31 "SKIP == mk_program(state, 0, Pow(state*state))" |
32 |
32 |
33 (* Coercion from anything to program *) |
33 (* Coercion from anything to program *) |
34 definition |
34 definition |
35 programify :: "i=>i" where |
35 programify :: "i=>i" where |
66 |
66 |
67 definition |
67 definition |
68 initially :: "i=>i" where |
68 initially :: "i=>i" where |
69 "initially(A) == {F \<in> program. Init(F)\<subseteq>A}" |
69 "initially(A) == {F \<in> program. Init(F)\<subseteq>A}" |
70 |
70 |
71 definition "constrains" :: "[i, i] => i" (infixl "co" 60) where |
71 definition "constrains" :: "[i, i] => i" (infixl \<open>co\<close> 60) where |
72 "A co B == {F \<in> program. (\<forall>act \<in> Acts(F). act``A\<subseteq>B) & st_set(A)}" |
72 "A co B == {F \<in> program. (\<forall>act \<in> Acts(F). act``A\<subseteq>B) & st_set(A)}" |
73 \<comment> \<open>the condition @{term "st_set(A)"} makes the definition slightly |
73 \<comment> \<open>the condition @{term "st_set(A)"} makes the definition slightly |
74 stronger than the HOL one\<close> |
74 stronger than the HOL one\<close> |
75 |
75 |
76 definition unless :: "[i, i] => i" (infixl "unless" 60) where |
76 definition unless :: "[i, i] => i" (infixl \<open>unless\<close> 60) where |
77 "A unless B == (A - B) co (A \<union> B)" |
77 "A unless B == (A - B) co (A \<union> B)" |
78 |
78 |
79 definition |
79 definition |
80 stable :: "i=>i" where |
80 stable :: "i=>i" where |
81 "stable(A) == A co A" |
81 "stable(A) == A co A" |
88 invariant :: "i => i" where |
88 invariant :: "i => i" where |
89 "invariant(A) == initially(A) \<inter> stable(A)" |
89 "invariant(A) == initially(A) \<inter> stable(A)" |
90 |
90 |
91 (* meta-function composition *) |
91 (* meta-function composition *) |
92 definition |
92 definition |
93 metacomp :: "[i=>i, i=>i] => (i=>i)" (infixl "comp" 65) where |
93 metacomp :: "[i=>i, i=>i] => (i=>i)" (infixl \<open>comp\<close> 65) where |
94 "f comp g == %x. f(g(x))" |
94 "f comp g == %x. f(g(x))" |
95 |
95 |
96 definition |
96 definition |
97 pg_compl :: "i=>i" where |
97 pg_compl :: "i=>i" where |
98 "pg_compl(X)== program - X" |
98 "pg_compl(X)== program - X" |