src/HOL/IMP/Def_Ass_Big.thy
author wenzelm
Sat, 07 Apr 2012 16:41:59 +0200
changeset 47389 e8552cba702d
parent 43158 686fa0a0696e
child 47818 151d137f1095
permissions -rw-r--r--
explicit checks stable_finished_theory/stable_command allow parallel asynchronous command transactions; tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43158
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     1
(* Author: Tobias Nipkow *)
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     2
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     3
theory Def_Ass_Big imports Com Def_Ass_Exp
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     4
begin
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     5
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     6
subsection "Initialization-Sensitive Big Step Semantics"
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     7
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     8
inductive
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     9
  big_step :: "(com \<times> state option) \<Rightarrow> state option \<Rightarrow> bool" (infix "\<Rightarrow>" 55)
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    10
where
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    11
None: "(c,None) \<Rightarrow> None" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    12
Skip: "(SKIP,s) \<Rightarrow> s" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    13
AssignNone: "aval a s = None \<Longrightarrow> (x ::= a, Some s) \<Rightarrow> None" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    14
Assign: "aval a s = Some i \<Longrightarrow> (x ::= a, Some s) \<Rightarrow> Some(s(x := Some i))" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    15
Semi:   "(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" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    16
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    17
IfNone:  "bval b s = None \<Longrightarrow> (IF b THEN c\<^isub>1 ELSE c\<^isub>2,Some s) \<Rightarrow> None" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    18
IfTrue:  "\<lbrakk> bval b s = Some True;  (c\<^isub>1,Some s) \<Rightarrow> s' \<rbrakk> \<Longrightarrow>
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    19
  (IF b THEN c\<^isub>1 ELSE c\<^isub>2,Some s) \<Rightarrow> s'" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    20
IfFalse: "\<lbrakk> bval b s = Some False;  (c\<^isub>2,Some s) \<Rightarrow> s' \<rbrakk> \<Longrightarrow>
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    21
  (IF b THEN c\<^isub>1 ELSE c\<^isub>2,Some s) \<Rightarrow> s'" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    22
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    23
WhileNone: "bval b s = None \<Longrightarrow> (WHILE b DO c,Some s) \<Rightarrow> None" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    24
WhileFalse: "bval b s = Some False \<Longrightarrow> (WHILE b DO c,Some s) \<Rightarrow> Some s" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    25
WhileTrue:
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    26
  "\<lbrakk> bval b s = Some True;  (c,Some s) \<Rightarrow> s';  (WHILE b DO c,s') \<Rightarrow> s'' \<rbrakk> \<Longrightarrow>
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    27
  (WHILE b DO c,Some s) \<Rightarrow> s''"
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    28
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    29
lemmas big_step_induct = big_step.induct[split_format(complete)]
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    30
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    31
end