author | nipkow |
Wed, 22 May 2013 08:46:39 +0200 | |
changeset 52108 | 06db08182c4b |
parent 52046 | bc01725d7918 |
child 52726 | ee0bd6bababd |
permissions | -rw-r--r-- |
43158 | 1 |
(* Author: Tobias Nipkow *) |
2 |
||
50161 | 3 |
theory Def_Init_Big |
4 |
imports Com Def_Init_Exp |
|
43158 | 5 |
begin |
6 |
||
7 |
subsection "Initialization-Sensitive Big Step Semantics" |
|
8 |
||
9 |
inductive |
|
10 |
big_step :: "(com \<times> state option) \<Rightarrow> state option \<Rightarrow> bool" (infix "\<Rightarrow>" 55) |
|
11 |
where |
|
12 |
None: "(c,None) \<Rightarrow> None" | |
|
13 |
Skip: "(SKIP,s) \<Rightarrow> s" | |
|
14 |
AssignNone: "aval a s = None \<Longrightarrow> (x ::= a, Some s) \<Rightarrow> None" | |
|
15 |
Assign: "aval a s = Some i \<Longrightarrow> (x ::= a, Some s) \<Rightarrow> Some(s(x := Some i))" | |
|
52046
bc01725d7918
replaced `;' by `;;' to disambiguate syntax; unexpected slight increase in build time
nipkow
parents:
50161
diff
changeset
|
16 |
Seq: "(c\<^isub>1,s\<^isub>1) \<Rightarrow> s\<^isub>2 \<Longrightarrow> (c\<^isub>2,s\<^isub>2) \<Rightarrow> s\<^isub>3 \<Longrightarrow> (c\<^isub>1;;c\<^isub>2,s\<^isub>1) \<Rightarrow> s\<^isub>3" | |
43158 | 17 |
|
18 |
IfNone: "bval b s = None \<Longrightarrow> (IF b THEN c\<^isub>1 ELSE c\<^isub>2,Some s) \<Rightarrow> None" | |
|
19 |
IfTrue: "\<lbrakk> bval b s = Some True; (c\<^isub>1,Some s) \<Rightarrow> s' \<rbrakk> \<Longrightarrow> |
|
20 |
(IF b THEN c\<^isub>1 ELSE c\<^isub>2,Some s) \<Rightarrow> s'" | |
|
21 |
IfFalse: "\<lbrakk> bval b s = Some False; (c\<^isub>2,Some s) \<Rightarrow> s' \<rbrakk> \<Longrightarrow> |
|
22 |
(IF b THEN c\<^isub>1 ELSE c\<^isub>2,Some s) \<Rightarrow> s'" | |
|
23 |
||
24 |
WhileNone: "bval b s = None \<Longrightarrow> (WHILE b DO c,Some s) \<Rightarrow> None" | |
|
25 |
WhileFalse: "bval b s = Some False \<Longrightarrow> (WHILE b DO c,Some s) \<Rightarrow> Some s" | |
|
26 |
WhileTrue: |
|
27 |
"\<lbrakk> bval b s = Some True; (c,Some s) \<Rightarrow> s'; (WHILE b DO c,s') \<Rightarrow> s'' \<rbrakk> \<Longrightarrow> |
|
28 |
(WHILE b DO c,Some s) \<Rightarrow> s''" |
|
29 |
||
30 |
lemmas big_step_induct = big_step.induct[split_format(complete)] |
|
31 |
||
32 |
end |