src/HOL/IMP/Def_Ass_Small.thy
author nipkow
Sat, 28 Apr 2012 07:38:22 +0200
changeset 47818 151d137f1095
parent 43158 686fa0a0696e
permissions -rw-r--r--
renamed Semi to Seq
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_Small imports Star 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 Small 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
  small_step :: "(com \<times> state) \<Rightarrow> (com \<times> state) \<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
Assign:  "aval a s = Some i \<Longrightarrow> (x ::= a, s) \<rightarrow> (SKIP, s(x := Some i))" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    12
47818
151d137f1095 renamed Semi to Seq
nipkow
parents: 43158
diff changeset
    13
Seq1:   "(SKIP;c,s) \<rightarrow> (c,s)" |
151d137f1095 renamed Semi to Seq
nipkow
parents: 43158
diff changeset
    14
Seq2:   "(c\<^isub>1,s) \<rightarrow> (c\<^isub>1',s') \<Longrightarrow> (c\<^isub>1;c\<^isub>2,s) \<rightarrow> (c\<^isub>1';c\<^isub>2,s')" |
43158
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    15
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    16
IfTrue:  "bval b s = Some True \<Longrightarrow> (IF b THEN c\<^isub>1 ELSE c\<^isub>2,s) \<rightarrow> (c\<^isub>1,s)" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    17
IfFalse: "bval b s = Some False \<Longrightarrow> (IF b THEN c\<^isub>1 ELSE c\<^isub>2,s) \<rightarrow> (c\<^isub>2,s)" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    18
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    19
While:   "(WHILE b DO c,s) \<rightarrow> (IF b THEN c; WHILE b DO c ELSE SKIP,s)"
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    20
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    21
lemmas small_step_induct = small_step.induct[split_format(complete)]
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    22
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    23
abbreviation small_steps :: "com * state \<Rightarrow> com * state \<Rightarrow> bool" (infix "\<rightarrow>*" 55)
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    24
where "x \<rightarrow>* y == star small_step x y"
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    25
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    26
end