src/HOL/IMP/Def_Init.thy
author paulson <lp15@cam.ac.uk>
Wed, 28 Sep 2016 17:01:01 +0100
changeset 63952 354808e9f44b
parent 53015 a1119cf551e8
permissions -rw-r--r--
new material connected with HOL Light measure theory, plus more rationalisation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50161
4fc4237488ab tuned names
nipkow
parents: 47818
diff changeset
     1
theory Def_Init
4fc4237488ab tuned names
nipkow
parents: 47818
diff changeset
     2
imports Vars Com
43158
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     3
begin
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     4
50161
4fc4237488ab tuned names
nipkow
parents: 47818
diff changeset
     5
subsection "Definite Initialization Analysis"
43158
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     6
45212
e87feee00a4c renamed name -> vname
nipkow
parents: 43158
diff changeset
     7
inductive D :: "vname set \<Rightarrow> com \<Rightarrow> vname set \<Rightarrow> bool" where
43158
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     8
Skip: "D A SKIP A" |
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
     9
Assign: "vars a \<subseteq> A \<Longrightarrow> D A (x ::= a) (insert x A)" |
53015
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52046
diff changeset
    10
Seq: "\<lbrakk> D A\<^sub>1 c\<^sub>1 A\<^sub>2;  D A\<^sub>2 c\<^sub>2 A\<^sub>3 \<rbrakk> \<Longrightarrow> D A\<^sub>1 (c\<^sub>1;; c\<^sub>2) A\<^sub>3" |
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52046
diff changeset
    11
If: "\<lbrakk> vars b \<subseteq> A;  D A c\<^sub>1 A\<^sub>1;  D A c\<^sub>2 A\<^sub>2 \<rbrakk> \<Longrightarrow>
a1119cf551e8 standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents: 52046
diff changeset
    12
  D A (IF b THEN c\<^sub>1 ELSE c\<^sub>2) (A\<^sub>1 Int A\<^sub>2)" |
43158
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    13
While: "\<lbrakk> vars b \<subseteq> A;  D A c A' \<rbrakk> \<Longrightarrow> D A (WHILE b DO c) A"
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    14
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    15
inductive_cases [elim!]:
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    16
"D A SKIP A'"
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    17
"D A (x ::= a) A'"
52046
bc01725d7918 replaced `;' by `;;' to disambiguate syntax; unexpected slight increase in build time
nipkow
parents: 50161
diff changeset
    18
"D A (c1;;c2) A'"
43158
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    19
"D A (IF b THEN c1 ELSE c2) A'"
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    20
"D A (WHILE b DO c) A'"
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    21
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    22
lemma D_incr: 
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    23
  "D A c A' \<Longrightarrow> A \<subseteq> A'"
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    24
by (induct rule: D.induct) auto
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    25
686fa0a0696e imported rest of new IMP
kleing
parents:
diff changeset
    26
end