equal
deleted
inserted
replaced
2 |
2 |
3 theory Small_Step imports Star Big_Step begin |
3 theory Small_Step imports Star Big_Step begin |
4 |
4 |
5 subsection "The transition relation" |
5 subsection "The transition relation" |
6 |
6 |
7 text_raw{*\snip{SmallStepDef}{0}{2}{% *} |
|
8 inductive |
7 inductive |
9 small_step :: "com * state \<Rightarrow> com * state \<Rightarrow> bool" (infix "\<rightarrow>" 55) |
8 small_step :: "com * state \<Rightarrow> com * state \<Rightarrow> bool" (infix "\<rightarrow>" 55) |
10 where |
9 where |
11 Assign: "(x ::= a, s) \<rightarrow> (SKIP, s(x := aval a s))" | |
10 Assign: "(x ::= a, s) \<rightarrow> (SKIP, s(x := aval a s))" | |
12 |
11 |
16 IfTrue: "bval b s \<Longrightarrow> (IF b THEN c\<^sub>1 ELSE c\<^sub>2,s) \<rightarrow> (c\<^sub>1,s)" | |
15 IfTrue: "bval b s \<Longrightarrow> (IF b THEN c\<^sub>1 ELSE c\<^sub>2,s) \<rightarrow> (c\<^sub>1,s)" | |
17 IfFalse: "\<not>bval b s \<Longrightarrow> (IF b THEN c\<^sub>1 ELSE c\<^sub>2,s) \<rightarrow> (c\<^sub>2,s)" | |
16 IfFalse: "\<not>bval b s \<Longrightarrow> (IF b THEN c\<^sub>1 ELSE c\<^sub>2,s) \<rightarrow> (c\<^sub>2,s)" | |
18 |
17 |
19 While: "(WHILE b DO c,s) \<rightarrow> |
18 While: "(WHILE b DO c,s) \<rightarrow> |
20 (IF b THEN c;; WHILE b DO c ELSE SKIP,s)" |
19 (IF b THEN c;; WHILE b DO c ELSE SKIP,s)" |
21 text_raw{*}%endsnip*} |
|
22 |
20 |
23 |
21 |
24 abbreviation |
22 abbreviation |
25 small_steps :: "com * state \<Rightarrow> com * state \<Rightarrow> bool" (infix "\<rightarrow>*" 55) |
23 small_steps :: "com * state \<Rightarrow> com * state \<Rightarrow> bool" (infix "\<rightarrow>*" 55) |
26 where "x \<rightarrow>* y == star small_step x y" |
24 where "x \<rightarrow>* y == star small_step x y" |