thys/Re1.thy
author Christian Urban <urbanc@in.tum.de>
Sat, 25 Apr 2015 10:58:48 +0100
changeset 76 39cef7b9212a
parent 75 f95a405c3180
child 77 4b4c677501e7
permissions -rw-r--r--
added an equivalent slightly simpler POSIX definition
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
5bc72d6d633d updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 55
diff changeset
     1
   
11
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
     2
theory Re1
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
  imports "Main" 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
begin
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
section {* Sequential Composition of Sets *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
definition
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
  Sequ :: "string set \<Rightarrow> string set \<Rightarrow> string set" ("_ ;; _" [100,100] 100)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
where 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
  "A ;; B = {s1 @ s2 | s1 s2. s1 \<in> A \<and> s2 \<in> B}"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
text {* Two Simple Properties about Sequential Composition *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
lemma seq_empty [simp]:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
  shows "A ;; {[]} = A"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
  and   "{[]} ;; A = A"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
by (simp_all add: Sequ_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
lemma seq_null [simp]:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
  shows "A ;; {} = {}"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
  and   "{} ;; A = {}"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
by (simp_all add: Sequ_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    25
section {* Regular Expressions *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    26
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    27
datatype rexp =
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
  NULL
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
| EMPTY
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
| CHAR char
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
| SEQ rexp rexp
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
| ALT rexp rexp
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    34
fun SEQS :: "rexp \<Rightarrow> rexp list \<Rightarrow> rexp"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    35
where
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    36
  "SEQS r [] = r"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    37
| "SEQS r (r'#rs) = SEQ r (SEQS r' rs)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    38
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
section {* Semantics of Regular Expressions *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
fun
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
  L :: "rexp \<Rightarrow> string set"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    43
where
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    44
  "L (NULL) = {}"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
| "L (EMPTY) = {[]}"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
| "L (CHAR c) = {[c]}"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    47
| "L (SEQ r1 r2) = (L r1) ;; (L r2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    48
| "L (ALT r1 r2) = (L r1) \<union> (L r2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    50
fun
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    51
 nullable :: "rexp \<Rightarrow> bool"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    52
where
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    53
  "nullable (NULL) = False"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    54
| "nullable (EMPTY) = True"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    55
| "nullable (CHAR c) = False"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    56
| "nullable (ALT r1 r2) = (nullable r1 \<or> nullable r2)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    57
| "nullable (SEQ r1 r2) = (nullable r1 \<and> nullable r2)"
70
fahad
parents: 68
diff changeset
    58
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    59
fun
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    60
 nullable_left :: "rexp \<Rightarrow> bool"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    61
where
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    62
  "nullable_left (NULL) = False"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    63
| "nullable_left (EMPTY) = True"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    64
| "nullable_left (CHAR c) = False"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    65
| "nullable_left (ALT r1 r2) = (nullable_left r1 \<or> nullable_left r2)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    66
| "nullable_left (SEQ r1 r2) = nullable_left r1"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    67
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    68
lemma nullable_left:
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    69
  "nullable r \<Longrightarrow> nullable_left r"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    70
apply(induct r)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    71
apply(auto)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    72
done
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    73
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    74
54
45274393f28c no changes
fahad
parents: 53
diff changeset
    75
value "L(CHAR c)"
45274393f28c no changes
fahad
parents: 53
diff changeset
    76
value "L(SEQ(CHAR c)(CHAR b))"
45274393f28c no changes
fahad
parents: 53
diff changeset
    77
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    78
lemma nullable_correctness:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    79
  shows "nullable r  \<longleftrightarrow> [] \<in> (L r)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    80
apply (induct r) 
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    81
apply(auto simp add: Sequ_def) 
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
    82
done
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    83
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    84
section {* Values *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    85
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    86
datatype val = 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    87
  Void
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    88
| Char char
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    89
| Seq val val
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    90
| Right val
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    91
| Left val
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    92
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    93
fun Seqs :: "val \<Rightarrow> val list \<Rightarrow> val"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    94
where
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    95
  "Seqs v [] = v"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    96
| "Seqs v (v'#vs) = Seq v (Seqs v' vs)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    97
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
    98
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    99
section {* The string behind a value *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   100
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   101
fun flat :: "val \<Rightarrow> string"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   102
where
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   103
  "flat(Void) = []"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   104
| "flat(Char c) = [c]"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   105
| "flat(Left v) = flat(v)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   106
| "flat(Right v) = flat(v)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   107
| "flat(Seq v1 v2) = flat(v1) @ flat(v2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   108
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   109
fun flat_left :: "val \<Rightarrow> string"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   110
where
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   111
  "flat_left(Void) = []"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   112
| "flat_left(Char c) = [c]"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   113
| "flat_left(Left v) = flat_left(v)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   114
| "flat_left(Right v) = flat_left(v)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   115
| "flat_left(Seq v1 v2) = flat_left(v1)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   116
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   117
fun flat_right :: "val \<Rightarrow> string"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   118
where
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   119
  "flat_right(Void) = []"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   120
| "flat_right(Char c) = [c]"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   121
| "flat_right(Left v) = flat(v)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   122
| "flat_right(Right v) = flat(v)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   123
| "flat_right(Seq v1 v2) = flat(v2)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   124
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   125
fun head :: "val \<Rightarrow> string"
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   126
where
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   127
  "head(Void) = []"
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   128
| "head(Char c) = [c]"
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   129
| "head(Left v) = head(v)"
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   130
| "head(Right v) = head(v)"
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   131
| "head(Seq v1 v2) = head v1"
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   132
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   133
fun flats :: "val \<Rightarrow> string list"
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   134
where
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   135
  "flats(Void) = [[]]"
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   136
| "flats(Char c) = [[c]]"
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   137
| "flats(Left v) = flats(v)"
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   138
| "flats(Right v) = flats(v)"
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   139
| "flats(Seq v1 v2) = (flats v1) @ (flats v2)"
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   140
70
fahad
parents: 68
diff changeset
   141
value "flats(Seq(Char c)(Char b))"
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   142
76
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   143
inductive StrOrd :: "string list \<Rightarrow> string list \<Rightarrow> bool" ("_ \<sqsupset> _" [100, 100] 100)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   144
where
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   145
   "[] \<sqsupset> []"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   146
|  "xs \<sqsupset> ys \<Longrightarrow> (x#xs) \<sqsupset> (x#ys)"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   147
|  "length x \<ge> length y \<Longrightarrow> (x#xs) \<sqsupset> (y#xs)"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   148
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   149
lemma StrOrd_append: 
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   150
  "xs \<sqsupset> ys \<Longrightarrow> (zs @ xs) \<sqsupset> (zs @ ys)"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   151
apply(induct zs)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   152
apply(auto intro: StrOrd.intros) 
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   153
done
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   154
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   155
section {* Relation between values and regular expressions *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   156
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   157
inductive Prf :: "val \<Rightarrow> rexp \<Rightarrow> bool" ("\<turnstile> _ : _" [100, 100] 100)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   158
where
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   159
 "\<lbrakk>\<turnstile> v1 : r1; \<turnstile> v2 : r2\<rbrakk> \<Longrightarrow> \<turnstile> Seq v1 v2 : SEQ r1 r2"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   160
| "\<turnstile> v1 : r1 \<Longrightarrow> \<turnstile> Left v1 : ALT r1 r2"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   161
| "\<turnstile> v2 : r2 \<Longrightarrow> \<turnstile> Right v2 : ALT r1 r2"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   162
| "\<turnstile> Void : EMPTY"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   163
| "\<turnstile> Char c : CHAR c"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   164
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   165
inductive Prfs :: "val list \<Rightarrow> rexp list \<Rightarrow> bool"  ("\<Turnstile> _ : _" [100, 100] 100)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   166
where
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   167
  "\<Turnstile> [] : []"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   168
| "\<lbrakk>\<turnstile>v : r; \<Turnstile> vs : rs\<rbrakk> \<Longrightarrow> \<Turnstile> (v#vs) : (r#rs)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   169
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   170
fun mkeps :: "rexp \<Rightarrow> val"
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   171
where
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   172
  "mkeps(EMPTY) = Void"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   173
| "mkeps(SEQ r1 r2) = Seq (mkeps r1) (mkeps r2)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   174
| "mkeps(ALT r1 r2) = (if nullable(r1) then Left (mkeps r1) else Right (mkeps r2))"
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   175
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   176
lemma mkeps_nullable:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   177
  assumes "nullable(r)" shows "\<turnstile> mkeps r : r"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   178
using assms
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   179
apply(induct rule: nullable.induct)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   180
apply(auto intro: Prf.intros)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   181
done
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   182
54
45274393f28c no changes
fahad
parents: 53
diff changeset
   183
value "flat(Seq(Char c)(Char b))"
45274393f28c no changes
fahad
parents: 53
diff changeset
   184
value "flat(Right(Void))"
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   185
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   186
lemma mkeps_flat:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   187
  assumes "nullable(r)" shows "flat (mkeps r) = []"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   188
using assms
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   189
apply(induct rule: nullable.induct)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   190
apply(auto)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   191
done
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   192
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   193
lemma mkeps_flat_left:
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   194
  assumes "nullable(r)" shows "flat_left (mkeps r) = []"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   195
using assms
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   196
apply(induct rule: nullable.induct)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   197
apply(auto)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   198
done
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   199
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   200
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   201
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   202
text {*
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   203
  The value mkeps returns is always the correct POSIX
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   204
  value.
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   205
*}
70
fahad
parents: 68
diff changeset
   206
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   207
70
fahad
parents: 68
diff changeset
   208
fahad
parents: 68
diff changeset
   209
54
45274393f28c no changes
fahad
parents: 53
diff changeset
   210
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   211
lemma Prf_flat_L:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   212
  assumes "\<turnstile> v : r" shows "flat v \<in> L r"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   213
using assms
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   214
apply(induct v r rule: Prf.induct)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   215
apply(auto simp add: Sequ_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   216
done
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   217
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   218
lemma L_flat_Prf:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   219
  "L(r) = {flat v | v. \<turnstile> v : r}"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   220
apply(induct r)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   221
apply(auto dest: Prf_flat_L simp add: Sequ_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   222
apply (metis Prf.intros(4) flat.simps(1))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   223
apply (metis Prf.intros(5) flat.simps(2))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   224
apply (metis Prf.intros(1) flat.simps(5))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   225
apply (metis Prf.intros(2) flat.simps(3))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   226
apply (metis Prf.intros(3) flat.simps(4))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   227
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   228
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   229
done
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   230
70
fahad
parents: 68
diff changeset
   231
definition prefix :: "string \<Rightarrow> string \<Rightarrow> bool" ("_ \<sqsubset> _" [100, 100] 100)
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   232
where
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   233
  "s1 \<sqsubset> s2 \<equiv> \<exists>s3. s1 @ s3 = s2"
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   234
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   235
section {* Ordering of values *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   236
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   237
inductive ValOrd :: "val \<Rightarrow> rexp \<Rightarrow> val \<Rightarrow> bool" ("_ \<succ>_ _" [100, 100, 100] 100)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   238
where
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   239
  "v2 \<succ>r2 v2' \<Longrightarrow> (Seq v1 v2) \<succ>(SEQ r1 r2) (Seq v1 v2')" 
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   240
| "\<lbrakk>v1 \<succ>r1 v1'; v1 \<noteq> v1'\<rbrakk> \<Longrightarrow> (Seq v1 v2) \<succ>(SEQ r1 r2) (Seq v1' v2')" 
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   241
| "length (flat v1) \<ge> length (flat v2) \<Longrightarrow> (Left v1) \<succ>(ALT r1 r2) (Right v2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   242
| "length (flat v2) > length (flat v1) \<Longrightarrow> (Right v2) \<succ>(ALT r1 r2) (Left v1)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   243
| "v2 \<succ>r2 v2' \<Longrightarrow> (Right v2) \<succ>(ALT r1 r2) (Right v2')"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   244
| "v1 \<succ>r1 v1' \<Longrightarrow> (Left v1) \<succ>(ALT r1 r2) (Left v1')"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   245
| "Void \<succ>EMPTY Void"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   246
| "(Char c) \<succ>(CHAR c) (Char c)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   247
76
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   248
inductive ValOrd2 :: "val \<Rightarrow> val \<Rightarrow> bool" ("_ 2\<succ> _" [100, 100] 100)
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   249
where
76
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   250
  "v2 2\<succ> v2' \<Longrightarrow> (Seq v1 v2) 2\<succ> (Seq v1 v2')" 
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   251
| "\<lbrakk>v1 2\<succ> v1'; v1 \<noteq> v1'\<rbrakk> \<Longrightarrow> (Seq v1 v2) 2\<succ> (Seq v1' v2')" 
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   252
| "length (flat v1) \<ge> length (flat v2) \<Longrightarrow> (Left v1) 2\<succ> (Right v2)"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   253
| "length (flat v2) > length (flat v1) \<Longrightarrow> (Right v2) 2\<succ> (Left v1)"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   254
| "v2 2\<succ> v2' \<Longrightarrow> (Right v2) 2\<succ> (Right v2')"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   255
| "v1 2\<succ> v1' \<Longrightarrow> (Left v1) 2\<succ> (Left v1')"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   256
| "Void 2\<succ> Void"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   257
| "(Char c) 2\<succ> (Char c)"
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   258
76
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   259
lemma Ord1:
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   260
  "v1 \<succ>r v2 \<Longrightarrow> v1 2\<succ> v2"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   261
apply(induct rule: ValOrd.induct)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   262
apply(auto intro: ValOrd2.intros)
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   263
done
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   264
76
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   265
lemma Ord2:
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   266
  "v1 2\<succ> v2 \<Longrightarrow> \<exists>r. v1 \<succ>r v2"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   267
apply(induct v1 v2 rule: ValOrd2.induct)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   268
apply(auto intro: ValOrd.intros)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   269
done
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   270
76
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   271
lemma Ord3:
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   272
  "\<lbrakk>v1 2\<succ> v2; \<turnstile> v1 : r\<rbrakk> \<Longrightarrow> v1 \<succ>r v2"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   273
apply(induct v1 v2 arbitrary: r rule: ValOrd2.induct)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   274
apply(auto intro: ValOrd.intros elim: Prf.cases)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   275
done
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   276
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   277
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   278
lemma ValOrd_refl:
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   279
  assumes "\<turnstile> v : r"
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   280
  shows "v \<succ>r v"
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   281
using assms
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   282
apply(induct)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   283
apply(auto intro: ValOrd.intros)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   284
done
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   285
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   286
section {* Posix definition *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   287
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   288
definition POSIX :: "val \<Rightarrow> rexp \<Rightarrow> bool" 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   289
where
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   290
  "POSIX v r \<equiv> (\<turnstile> v : r \<and> (\<forall>v'. (\<turnstile> v' : r \<and> flat v = flat v') \<longrightarrow> v \<succ>r v'))"
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   291
76
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   292
definition POSIX2 :: "val \<Rightarrow> rexp \<Rightarrow> bool" 
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   293
where
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   294
  "POSIX2 v r \<equiv> (\<turnstile> v : r \<and> (\<forall>v'. (\<turnstile> v' : r \<and> flat v = flat v') \<longrightarrow> v 2\<succ> v'))"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   295
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   296
lemma "POSIX v r = POSIX2 v r"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   297
unfolding POSIX_def POSIX2_def
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   298
apply(auto)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   299
apply(rule Ord1)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   300
apply(auto)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   301
apply(rule Ord3)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   302
apply(auto)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   303
done
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   304
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   305
(*
11
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
   306
an alternative definition: might cause problems
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
   307
with theorem mkeps_POSIX
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
   308
*)
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
   309
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   310
(*
11
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
   311
definition POSIX2 :: "val \<Rightarrow> rexp \<Rightarrow> bool" 
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
   312
where
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
   313
  "POSIX2 v r \<equiv> \<turnstile> v : r \<and> (\<forall>v'. \<turnstile> v' : r \<longrightarrow> v \<succ>r v')"
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   314
*)
11
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
   315
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   316
(*
20
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   317
definition POSIX3 :: "val \<Rightarrow> rexp \<Rightarrow> bool" 
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   318
where
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   319
  "POSIX3 v r \<equiv> \<turnstile> v : r \<and> (\<forall>v'. (\<turnstile> v' : r \<and> length (flat v') \<le> length(flat v)) \<longrightarrow> v \<succ>r v')"
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   320
*)
11
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
   321
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   322
lemma POSIX_SEQ1:
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   323
  assumes "POSIX (Seq v1 v2) (SEQ r1 r2)" "\<turnstile> v1 : r1" "\<turnstile> v2 : r2"
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   324
  shows "POSIX v1 r1"
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   325
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   326
unfolding POSIX_def
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   327
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   328
apply(drule_tac x="Seq v' v2" in spec)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   329
apply(simp)
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   330
apply(erule impE)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   331
apply(rule Prf.intros)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   332
apply(simp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   333
apply(simp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   334
apply(erule ValOrd.cases)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   335
apply(simp_all)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   336
apply(clarify)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   337
by (metis ValOrd_refl)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   338
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   339
lemma POSIX_SEQ2:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   340
  assumes "POSIX (Seq v1 v2) (SEQ r1 r2)" "\<turnstile> v1 : r1" "\<turnstile> v2 : r2" 
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   341
  shows "POSIX v2 r2"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   342
using assms
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   343
unfolding POSIX_def
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   344
apply(auto)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   345
apply(drule_tac x="Seq v1 v'" in spec)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   346
apply(simp)
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   347
apply(erule impE)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   348
apply(rule Prf.intros)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   349
apply(simp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   350
apply(simp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   351
apply(erule ValOrd.cases)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
   352
apply(simp_all)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   353
done
12
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   354
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   355
lemma POSIX_ALT2:
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   356
  assumes "POSIX (Left v1) (ALT r1 r2)"
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   357
  shows "POSIX v1 r1"
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   358
using assms
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   359
unfolding POSIX_def
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   360
apply(auto)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   361
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   362
apply(simp_all)[5]
12
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   363
apply(drule_tac x="Left v'" in spec)
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   364
apply(simp)
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   365
apply(drule mp)
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   366
apply(rule Prf.intros)
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   367
apply(auto)
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   368
apply(erule ValOrd.cases)
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   369
apply(simp_all)
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   370
done
232ea10bed6f Delete POSIX_ALT2
fahadausaf <fahad.ausaf@icloud.com>
parents: 11
diff changeset
   371
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   372
lemma POSIX_ALT1a:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   373
  assumes "POSIX (Right v2) (ALT r1 r2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   374
  shows "POSIX v2 r2"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   375
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   376
unfolding POSIX_def
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   377
apply(auto)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   378
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   379
apply(simp_all)[5]
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   380
apply(drule_tac x="Right v'" in spec)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   381
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   382
apply(drule mp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   383
apply(rule Prf.intros)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   384
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   385
apply(erule ValOrd.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   386
apply(simp_all)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   387
done
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   388
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   389
lemma POSIX_ALT1b:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   390
  assumes "POSIX (Right v2) (ALT r1 r2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   391
  shows "(\<forall>v'. (\<turnstile> v' : r2 \<and> flat v' = flat v2) \<longrightarrow> v2 \<succ>r2 v')"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   392
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   393
apply(drule_tac POSIX_ALT1a)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   394
unfolding POSIX_def
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   395
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   396
done
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   397
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   398
lemma POSIX_ALT_I1:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   399
  assumes "POSIX v1 r1" 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   400
  shows "POSIX (Left v1) (ALT r1 r2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   401
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   402
unfolding POSIX_def
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   403
apply(auto)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   404
apply (metis Prf.intros(2))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   405
apply(rotate_tac 2)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   406
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   407
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   408
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   409
apply(rule ValOrd.intros)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   410
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   411
apply(rule ValOrd.intros)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   412
by simp
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   413
20
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   414
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   415
lemma POSIX_ALT_I2:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   416
  assumes "POSIX v2 r2" "\<forall>v'. \<turnstile> v' : r1 \<longrightarrow> length (flat v2) > length (flat v')"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   417
  shows "POSIX (Right v2) (ALT r1 r2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   418
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   419
unfolding POSIX_def
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   420
apply(auto)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   421
apply (metis Prf.intros)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   422
apply(rotate_tac 3)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   423
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   424
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   425
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   426
apply(rule ValOrd.intros)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   427
apply metis
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   428
done
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   429
73
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   430
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   431
lemma 
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   432
  "\<lbrakk>POSIX (mkeps r2) r2; nullable r2; \<not> nullable r1\<rbrakk>
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   433
   \<Longrightarrow> POSIX (val.Right (mkeps r2)) (ALT r1 r2)" 
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   434
apply(auto simp add: POSIX_def)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   435
apply(rule Prf.intros(3))
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   436
apply(auto)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   437
apply(rotate_tac 3)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   438
apply(erule Prf.cases)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   439
apply(simp_all)[5]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   440
apply(simp add: mkeps_flat)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   441
apply(auto)[1]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   442
apply (metis Prf_flat_L nullable_correctness)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   443
apply(rule ValOrd.intros)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   444
apply(auto)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   445
done
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   446
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   447
lemma mkeps_POSIX:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   448
  assumes "nullable r"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   449
  shows "POSIX (mkeps r) r"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   450
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   451
apply(induct r)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   452
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   453
apply(simp add: POSIX_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   454
apply(auto)[1]
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   455
apply (metis Prf.intros(4))
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   456
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   457
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   458
apply (metis ValOrd.intros)
66
eb97e8361211 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 63
diff changeset
   459
apply(simp)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   460
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   461
apply(simp add: POSIX_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   462
apply(auto)[1]
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   463
apply (metis mkeps.simps(2) mkeps_nullable nullable.simps(5))
20
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   464
apply(rotate_tac 6)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   465
apply(erule Prf.cases)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   466
apply(simp_all)[5]
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   467
apply (simp add: mkeps_flat)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   468
apply(case_tac "mkeps r1a = v1")
20
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   469
apply(simp)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   470
apply (metis ValOrd.intros(1))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   471
apply (rule ValOrd.intros(2))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   472
apply metis
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   473
apply(simp)
71
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   474
(* ALT case *)
72
9128b9440e93 updated R1 and notes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 71
diff changeset
   475
thm mkeps.simps
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   476
apply(simp)
20
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   477
apply(erule disjE)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   478
apply(simp)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   479
apply (metis POSIX_ALT_I1)
71
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   480
(* *)
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   481
apply(auto)[1]
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   482
thm  POSIX_ALT_I1
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   483
apply (metis POSIX_ALT_I1)
71
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   484
apply(simp (no_asm) add: POSIX_def)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   485
apply(auto)[1]
71
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   486
apply(rule Prf.intros(3))
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   487
apply(simp only: POSIX_def)
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   488
apply(rotate_tac 4)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   489
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   490
apply(simp_all)[5]
72
9128b9440e93 updated R1 and notes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 71
diff changeset
   491
thm mkeps_flat
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   492
apply(simp add: mkeps_flat)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   493
apply(auto)[1]
71
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   494
thm Prf_flat_L nullable_correctness
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   495
apply (metis Prf_flat_L nullable_correctness)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   496
apply(rule ValOrd.intros)
71
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   497
apply(subst (asm) POSIX_def)
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   498
apply(clarify)
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   499
apply(drule_tac x="v2" in spec)
72
9128b9440e93 updated R1 and notes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 71
diff changeset
   500
by simp
20
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   501
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
   502
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   503
section {* Derivatives *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   504
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   505
fun
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   506
 der :: "char \<Rightarrow> rexp \<Rightarrow> rexp"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   507
where
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   508
  "der c (NULL) = NULL"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   509
| "der c (EMPTY) = NULL"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   510
| "der c (CHAR c') = (if c = c' then EMPTY else NULL)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   511
| "der c (ALT r1 r2) = ALT (der c r1) (der c r2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   512
| "der c (SEQ r1 r2) = 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   513
     (if nullable r1
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   514
      then ALT (SEQ (der c r1) r2) (der c r2)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   515
      else SEQ (der c r1) r2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   516
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   517
fun 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   518
 ders :: "string \<Rightarrow> rexp \<Rightarrow> rexp"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   519
where
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   520
  "ders [] r = r"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   521
| "ders (c # s) r = ders s (der c r)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   522
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   523
section {* Injection function *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   524
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   525
fun injval :: "rexp \<Rightarrow> char \<Rightarrow> val \<Rightarrow> val"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   526
where
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   527
  "injval (CHAR d) c Void = Char d"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   528
| "injval (ALT r1 r2) c (Left v1) = Left(injval r1 c v1)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   529
| "injval (ALT r1 r2) c (Right v2) = Right(injval r2 c v2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   530
| "injval (SEQ r1 r2) c (Seq v1 v2) = Seq (injval r1 c v1) v2"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   531
| "injval (SEQ r1 r2) c (Left (Seq v1 v2)) = Seq (injval r1 c v1) v2"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   532
| "injval (SEQ r1 r2) c (Right v2) = Seq (mkeps r1) (injval r2 c v2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   533
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   534
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   535
section {* Projection function *}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   536
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   537
fun projval :: "rexp \<Rightarrow> char \<Rightarrow> val \<Rightarrow> val"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   538
where
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   539
  "projval (CHAR d) c _ = Void"
71
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   540
| "projval (ALT r1 r2) c (Left v1) = Left (projval r1 c v1)"
2d30c74ba67f added a section about a nullable proof
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   541
| "projval (ALT r1 r2) c (Right v2) = Right (projval r2 c v2)"
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   542
| "projval (SEQ r1 r2) c (Seq v1 v2) = 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   543
     (if flat v1 = [] then Right(projval r2 c v2) 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   544
      else if nullable r1 then Left (Seq (projval r1 c v1) v2)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   545
                          else Seq (projval r1 c v1) v2)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   546
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   547
text {*
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   548
  Injection value is related to r
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   549
*}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   550
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   551
lemma v3:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   552
  assumes "\<turnstile> v : der c r" shows "\<turnstile> (injval r c v) : r"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   553
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   554
apply(induct arbitrary: v rule: der.induct)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   555
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   556
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   557
apply(simp_all)[5]
49
c616ec6b1e3c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 48
diff changeset
   558
apply(simp)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   559
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   560
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   561
apply(case_tac "c = c'")
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   562
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   563
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   564
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   565
apply (metis Prf.intros(5))
49
c616ec6b1e3c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 48
diff changeset
   566
apply(simp)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   567
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   568
apply(simp_all)[5]
49
c616ec6b1e3c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 48
diff changeset
   569
apply(simp)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   570
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   571
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   572
apply (metis Prf.intros(2))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   573
apply (metis Prf.intros(3))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   574
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   575
apply(case_tac "nullable r1")
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   576
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   577
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   578
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   579
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   580
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   581
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   582
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   583
apply (metis Prf.intros(1))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   584
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   585
apply (metis Prf.intros(1) mkeps_nullable)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   586
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   587
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   588
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   589
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   590
apply(rule Prf.intros)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   591
apply(auto)[2]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   592
done
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   593
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   594
lemma v3_proj:
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   595
  assumes "\<turnstile> v : r" and "\<exists>s. (flat v) = c # s"
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   596
  shows "\<turnstile> (projval r c v) : der c r"
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   597
using assms
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   598
apply(induct rule: Prf.induct)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   599
prefer 4
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   600
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   601
prefer 4
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   602
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   603
apply (metis Prf.intros(4))
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   604
prefer 2
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   605
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   606
apply (metis Prf.intros(2))
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   607
prefer 2
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   608
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   609
apply (metis Prf.intros(3))
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   610
apply(auto)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   611
apply(rule Prf.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   612
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   613
apply (metis Prf_flat_L nullable_correctness)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   614
apply(rule Prf.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   615
apply(rule Prf.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   616
apply (metis Cons_eq_append_conv)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   617
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   618
apply(rule Prf.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   619
apply (metis Cons_eq_append_conv)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   620
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   621
done
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   622
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   623
text {*
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   624
  The string behind the injection value is an added c
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   625
*}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   626
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   627
lemma v4:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   628
  assumes "\<turnstile> v : der c r" shows "flat (injval r c v) = c # (flat v)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   629
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   630
apply(induct arbitrary: v rule: der.induct)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   631
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   632
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   633
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   634
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   635
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   636
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   637
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   638
apply(case_tac "c = c'")
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   639
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   640
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   641
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   642
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   643
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   644
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   645
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   646
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   647
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   648
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   649
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   650
apply(case_tac "nullable r1")
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   651
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   652
apply(erule Prf.cases)
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   653
apply(simp_all (no_asm_use))[5]
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   654
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   655
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   656
apply(simp_all)[5]
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   657
apply(clarify)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   658
apply(simp only: injval.simps flat.simps)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   659
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   660
apply (metis mkeps_flat)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   661
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   662
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   663
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   664
done
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   665
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   666
lemma v4_flat_left:
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   667
  assumes "\<turnstile> v : der c r" "\<not>(nullable_left r)" shows "flat_left (injval r c v) = c # (flat_left v)"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   668
using assms
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   669
apply(induct arbitrary: v rule: der.induct)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   670
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   671
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   672
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   673
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   674
apply(case_tac "c = c'")
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   675
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   676
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   677
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   678
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   679
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   680
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   681
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   682
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   683
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   684
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   685
apply(case_tac "nullable r1")
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   686
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   687
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   688
apply(simp_all (no_asm_use))[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   689
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   690
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   691
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   692
apply(clarify)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   693
apply(simp only: injval.simps)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   694
apply (metis nullable_left)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   695
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   696
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   697
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   698
done
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   699
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   700
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   701
lemma v4_proj:
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   702
  assumes "\<turnstile> v : r" and "\<exists>s. (flat v) = c # s"
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   703
  shows "c # flat (projval r c v) = flat v"
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   704
using assms
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   705
apply(induct rule: Prf.induct)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   706
prefer 4
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   707
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   708
prefer 4
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   709
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   710
prefer 2
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   711
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   712
prefer 2
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   713
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   714
apply(auto)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   715
by (metis Cons_eq_append_conv)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   716
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   717
lemma v4_proj2:
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   718
  assumes "\<turnstile> v : r" and "(flat v) = c # s"
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   719
  shows "flat (projval r c v) = s"
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   720
using assms
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   721
by (metis list.inject v4_proj)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   722
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   723
lemma injval_inj: "inj_on (injval r c) {v. \<turnstile> v : der c r}"
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   724
apply(induct c r rule: der.induct)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   725
unfolding inj_on_def
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   726
apply(auto)[1]
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   727
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   728
apply(simp_all)[5]
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   729
apply(auto)[1]
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   730
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   731
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   732
apply(auto)[1]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   733
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   734
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   735
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   736
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   737
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   738
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   739
apply(auto)[1]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   740
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   741
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   742
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   743
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   744
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   745
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   746
apply(auto)[1]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   747
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   748
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   749
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   750
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   751
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   752
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   753
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   754
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   755
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   756
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   757
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   758
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   759
apply(clarify)
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   760
apply (metis list.distinct(1) mkeps_flat v4)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   761
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   762
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   763
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   764
apply(rotate_tac 6)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   765
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   766
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   767
apply (metis list.distinct(1) mkeps_flat v4)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   768
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   769
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   770
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   771
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   772
done
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   773
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   774
lemma t: "(c#xs = c#ys) \<Longrightarrow> xs = ys"
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   775
by (metis list.sel(3))
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   776
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   777
lemma t2: "(xs = ys) \<Longrightarrow> (c#xs) = (c#ys)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   778
by (metis)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   779
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   780
fun zeroable where
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   781
  "zeroable NULL = True"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   782
| "zeroable EMPTY = False"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   783
| "zeroable (CHAR c) = False"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   784
| "zeroable (ALT r1 r2) = (zeroable r1 \<and> zeroable r2)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   785
| "zeroable (SEQ r1 r2) = (zeroable r1 \<or> zeroable r2)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   786
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   787
lemma "\<not>(nullable r) \<Longrightarrow> \<not>(\<exists>v. \<turnstile> v : r \<and> flat v = [])"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   788
by (metis Prf_flat_L nullable_correctness)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
   789
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   790
lemma proj_inj_id:
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   791
  assumes "\<turnstile> v : der c r" 
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   792
  shows "projval r c (injval r c v) = v"
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   793
using assms
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   794
apply(induct c r arbitrary: v rule: der.induct)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
   795
apply(simp)
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   796
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   797
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   798
apply(simp)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   799
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   800
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   801
apply(simp)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   802
apply(case_tac "c = c'")
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   803
apply(simp)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   804
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   805
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   806
apply(simp)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   807
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   808
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   809
apply(simp)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   810
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   811
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   812
apply(simp)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   813
apply(case_tac "nullable r1")
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   814
apply(simp)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   815
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   816
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   817
apply(auto)[1]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   818
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   819
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   820
apply(auto)[1]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   821
apply (metis list.distinct(1) v4)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   822
apply(auto)[1]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   823
apply (metis mkeps_flat)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   824
apply(auto)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   825
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   826
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   827
apply(auto)[1]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   828
apply(simp add: v4)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   829
done
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
   830
73
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   831
lemma LeftRight:
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   832
  assumes "(Left v1) \<succ>(der c (ALT r1 r2)) (Right v2)"
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   833
  and "\<turnstile> v1 : der c r1" "\<turnstile> v2 : der c r2" 
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   834
  shows "(injval (ALT r1 r2) c (Left v1)) \<succ>(ALT r1 r2) (injval (ALT r1 r2) c (Right v2))"
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   835
using assms
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   836
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   837
apply(erule ValOrd.cases)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   838
apply(simp_all)[8]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   839
apply(rule ValOrd.intros)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   840
apply(clarify)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   841
apply(subst v4)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   842
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   843
apply(subst v4)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   844
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   845
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   846
done
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   847
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   848
lemma RightLeft:
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   849
  assumes "(Right v1) \<succ>(der c (ALT r1 r2)) (Left v2)"
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   850
  and "\<turnstile> v1 : der c r2" "\<turnstile> v2 : der c r1" 
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   851
  shows "(injval (ALT r1 r2) c (Right v1)) \<succ>(ALT r1 r2) (injval (ALT r1 r2) c (Left v2))"
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   852
using assms
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   853
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   854
apply(erule ValOrd.cases)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   855
apply(simp_all)[8]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   856
apply(rule ValOrd.intros)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   857
apply(clarify)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   858
apply(subst v4)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   859
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   860
apply(subst v4)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   861
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   862
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   863
done
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   864
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   865
lemma h: 
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   866
  assumes "nullable r1" "\<turnstile> v1 : der c r1"
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   867
  shows "injval r1 c v1 \<succ>r1 mkeps r1"
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   868
using assms
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   869
apply(induct r1 arbitrary: v1 rule: der.induct)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   870
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   871
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   872
apply(erule Prf.cases)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   873
apply(simp_all)[5]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   874
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   875
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   876
apply(erule Prf.cases)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   877
apply(simp_all)[5]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   878
apply(clarify)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   879
apply(auto)[1]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   880
apply (metis ValOrd.intros(6))
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   881
apply (metis ValOrd.intros(6))
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   882
apply (metis ValOrd.intros(3) le_add2 list.size(3) mkeps_flat monoid_add_class.add.right_neutral)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   883
apply(auto)[1]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   884
apply (metis ValOrd.intros(4) length_greater_0_conv list.distinct(1) list.size(3) mkeps_flat v4)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   885
apply (metis ValOrd.intros(4) length_greater_0_conv list.distinct(1) list.size(3) mkeps_flat v4)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   886
apply (metis ValOrd.intros(5))
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   887
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   888
apply(erule Prf.cases)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   889
apply(simp_all)[5]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   890
apply(clarify)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   891
apply(erule Prf.cases)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   892
apply(simp_all)[5]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   893
apply(clarify)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   894
apply (metis ValOrd.intros(2) list.distinct(1) mkeps_flat v4)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   895
apply(clarify)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   896
by (metis ValOrd.intros(1))
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   897
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   898
lemma LeftRightSeq:
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   899
  assumes "(Left (Seq v1 v2)) \<succ>(der c (SEQ r1 r2)) (Right v3)"
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   900
  and "nullable r1" "\<turnstile> v1 : der c r1"
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   901
  shows "(injval (SEQ r1 r2) c (Seq v1 v2)) \<succ>(SEQ r1 r2) (injval (SEQ r1 r2) c (Right v2))"
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   902
using assms
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   903
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   904
apply(erule ValOrd.cases)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   905
apply(simp_all)[8]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   906
apply(clarify)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   907
apply(simp)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   908
apply(rule ValOrd.intros(2))
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   909
prefer 2
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   910
apply (metis list.distinct(1) mkeps_flat v4)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   911
by (metis h)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
   912
76
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   913
lemma POSIX_der:
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   914
  assumes "POSIX2 v (der c r)" "\<turnstile> v : der c r"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   915
  shows "POSIX2 (injval r c v) r"
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   916
using assms
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   917
unfolding POSIX2_def
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   918
apply(auto)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   919
thm v3
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   920
apply (erule v3)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   921
thm v4
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   922
apply(subst (asm) v4)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   923
apply(assumption)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   924
apply(drule_tac x="projval r c v'" in spec)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   925
apply(drule mp)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   926
apply(rule conjI)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   927
thm v3_proj
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   928
apply(rule v3_proj)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   929
apply(simp)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   930
apply(rule_tac x="flat v" in exI)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   931
apply(simp)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   932
thm t
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   933
apply(rule_tac c="c" in  t)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   934
apply(simp)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   935
thm v4_proj
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   936
apply(subst v4_proj)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   937
apply(simp)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   938
apply(rule_tac x="flat v" in exI)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   939
apply(simp)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   940
apply(simp)
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   941
oops
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   942
39cef7b9212a added an equivalent slightly simpler POSIX definition
Christian Urban <urbanc@in.tum.de>
parents: 75
diff changeset
   943
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
   944
lemma Prf_inj_test:
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   945
  assumes "v1 \<succ>(der c r) v2" "\<turnstile> v1 : der c r" "\<turnstile> v2 : der c r"  "\<Turnstile> vs : rs" "flat v1 = flat v2"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   946
  shows "Seqs (injval r c v1) vs \<succ>(SEQS r rs) Seqs (injval r c v2) vs"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   947
using assms
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   948
apply(induct arbitrary: v1 v2 vs rs rule: der.induct)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   949
(* NULL case *)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   950
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   951
apply(erule ValOrd.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   952
apply(simp_all)[8]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   953
(* EMPTY case *)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   954
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   955
apply(erule ValOrd.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   956
apply(simp_all)[8]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   957
(* CHAR case *)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   958
apply(case_tac "c = c'")
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   959
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   960
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   961
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   962
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   963
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   964
apply (metis ValOrd.intros(8))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   965
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   966
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   967
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   968
(* ALT case *)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   969
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   970
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   971
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   972
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   973
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   974
apply(erule ValOrd.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   975
apply(simp_all)[8]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   976
apply (metis ValOrd.intros(6))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   977
apply(erule ValOrd.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   978
apply(simp_all)[8]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   979
apply (metis LeftRight ValOrd.intros(3) der.simps(4) injval.simps(2) injval.simps(3))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   980
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   981
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   982
apply(erule ValOrd.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   983
apply(simp_all)[8]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   984
apply (metis RightLeft ValOrd.intros(4) der.simps(4) injval.simps(2) injval.simps(3))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   985
apply(erule ValOrd.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   986
apply(simp_all)[8]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   987
apply (metis ValOrd.intros(5))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   988
(* SEQ case *)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   989
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   990
apply(case_tac "nullable r1")
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   991
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   992
defer
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   993
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   994
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   995
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   996
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   997
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   998
apply(clarify)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
   999
apply(erule ValOrd.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1000
apply(simp_all)[8]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1001
apply(clarify)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1002
apply(rule ValOrd.intros)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1003
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1004
apply(clarify)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1005
apply(rule ValOrd.intros(2))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1006
apply(rotate_tac 2)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1007
apply(drule_tac x="v1c" in meta_spec)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1008
apply(rotate_tac 10)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1009
apply(drule_tac x="v1'" in meta_spec)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1010
apply(drule_tac meta_mp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1011
apply(assumption)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1012
apply(drule_tac meta_mp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1013
apply(assumption)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1014
apply(drule_tac meta_mp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1015
apply(assumption)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1016
apply(drule_tac meta_mp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1017
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1018
apply(subst v4)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1019
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1020
apply(subst (asm) v4)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1021
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1022
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1023
apply(simp add: prefix_def)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1024
oops
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1025
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1026
lemma Prf_inj:
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1027
  assumes "v1 \<succ>(der c r) v2" "\<turnstile> v1 : der c r" "\<turnstile> v2 : der c r" (*"flat v1 = flat v2"*)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1028
  shows "(injval r c v1) \<succ>r (injval r c v2)"
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1029
using assms
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1030
apply(induct c r arbitrary: v1 v2 rule: der.induct)
55
c33cfa1e813a added some notes (still incomplete)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 53
diff changeset
  1031
(* NULL case *)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1032
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1033
apply(erule ValOrd.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1034
apply(simp_all)[8]
55
c33cfa1e813a added some notes (still incomplete)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 53
diff changeset
  1035
(* EMPTY case *)
72
9128b9440e93 updated R1 and notes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 71
diff changeset
  1036
apply(simp)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1037
apply(erule ValOrd.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1038
apply(simp_all)[8]
55
c33cfa1e813a added some notes (still incomplete)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 53
diff changeset
  1039
(* CHAR case *)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1040
apply(case_tac "c = c'")
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1041
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1042
apply(erule ValOrd.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1043
apply(simp_all)[8]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1044
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1045
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1046
apply(erule ValOrd.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1047
apply(simp_all)[8]
55
c33cfa1e813a added some notes (still incomplete)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 53
diff changeset
  1048
(* ALT case *)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1049
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1050
apply(erule ValOrd.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1051
apply(simp_all)[8]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1052
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1053
apply(subst v4)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1054
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1055
apply(rotate_tac 3)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1056
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1057
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1058
apply(subst v4)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1059
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1060
apply(rotate_tac 2)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1061
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1062
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1063
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1064
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1065
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1066
apply(rotate_tac 3)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1067
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1068
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1069
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1070
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1071
apply(simp_all)[5]
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1072
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1073
apply(subst v4)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1074
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1075
apply(subst v4)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1076
apply(simp)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1077
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1078
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1079
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1080
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1081
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1082
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1083
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1084
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1085
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1086
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1087
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1088
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1089
apply(simp_all)[5]
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1090
(* SEQ case*)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1091
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1092
apply(case_tac "nullable r1")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1093
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1094
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1095
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1096
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1097
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1098
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1099
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1100
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1101
apply(erule ValOrd.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1102
apply(simp_all)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1103
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1104
apply(rule ValOrd.intros)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1105
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1106
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1107
apply(rule ValOrd.intros(2))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1108
apply metis
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1109
using injval_inj
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1110
apply(simp add: inj_on_def)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1111
apply metis
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1112
(* SEQ nullable case *)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1113
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1114
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1115
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1116
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1117
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1118
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1119
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1120
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1121
apply(clarify)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1122
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1123
apply(simp_all)[5]
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1124
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1125
apply(erule ValOrd.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1126
apply(simp_all)[8]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1127
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1128
apply(erule ValOrd.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1129
apply(simp_all)[8]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1130
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1131
apply(rule ValOrd.intros(1))
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1132
apply(simp)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1133
apply(rule ValOrd.intros(2))
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1134
apply metis
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1135
using injval_inj
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1136
apply(simp add: inj_on_def)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1137
apply metis
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1138
apply(clarify)
73
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
  1139
apply(simp)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1140
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1141
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1142
apply(clarify)
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1143
apply(erule ValOrd.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1144
apply(simp_all)[8]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1145
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1146
apply(simp)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1147
apply(rule ValOrd.intros(2))
73
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
  1148
apply (metis h)
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1149
apply (metis list.distinct(1) mkeps_flat v4)
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1150
(* last case *)
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1151
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1152
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1153
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1154
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1155
apply(rotate_tac 6)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1156
apply(erule Prf.cases)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1157
apply(simp_all)[5]
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1158
apply(clarify)
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1159
prefer 2
73
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
  1160
apply(clarify)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
  1161
apply(erule ValOrd.cases)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
  1162
apply(simp_all)[8]
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
  1163
apply(clarify)
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
  1164
apply(rule ValOrd.intros(1))
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
  1165
apply(metis)
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1166
apply(rule ValOrd.intros(2))
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1167
prefer 2
73
6e035162345a solved one case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 72
diff changeset
  1168
thm mkeps_flat v4
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1169
apply (metis list.distinct(1) mkeps_flat v4)
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1170
oops
63
498171d2379a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 62
diff changeset
  1171
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1172
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1173
lemma POSIX_der:
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1174
  assumes "POSIX v (der c r)" "\<turnstile> v : der c r"
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1175
  shows "POSIX (injval r c v) r"
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1176
using assms
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1177
unfolding POSIX_def
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1178
apply(auto)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1179
thm v3
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1180
apply (erule v3)
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1181
thm v4
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1182
apply(subst (asm) v4)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1183
apply(assumption)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1184
apply(drule_tac x="projval r c v'" in spec)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1185
apply(drule mp)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1186
apply(rule conjI)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1187
thm v3_proj
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1188
apply(rule v3_proj)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1189
apply(simp)
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1190
apply(rule_tac x="flat v" in exI)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1191
apply(simp)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1192
thm t
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1193
apply(rule_tac c="c" in  t)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1194
apply(simp)
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1195
thm v4_proj
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1196
apply(subst v4_proj)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1197
apply(simp)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1198
apply(rule_tac x="flat v" in exI)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1199
apply(simp)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1200
apply(simp)
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1201
oops
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1202
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1203
lemma POSIX_der:
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1204
  assumes "POSIX v (der c r)" "\<turnstile> v : der c r"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1205
  shows "POSIX (injval r c v) r"
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1206
using assms
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1207
apply(induct c r arbitrary: v rule: der.induct)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1208
(* null case*)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1209
apply(simp add: POSIX_def)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1210
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1211
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1212
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1213
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1214
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1215
(* empty case *)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1216
apply(simp add: POSIX_def)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1217
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1218
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1219
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1220
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1221
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1222
(* char case *)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1223
apply(simp add: POSIX_def)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1224
apply(case_tac "c = c'")
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1225
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1226
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1227
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1228
apply (metis Prf.intros(5))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1229
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1230
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1231
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1232
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1233
apply (metis ValOrd.intros(8))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1234
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1235
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1236
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1237
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1238
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1239
(* alt case *)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1240
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1241
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1242
apply(clarify)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1243
apply(simp (no_asm) add: POSIX_def)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1244
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1245
apply (metis Prf.intros(2) v3)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1246
apply(rotate_tac 4)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1247
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1248
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1249
apply (metis POSIX_ALT2 POSIX_def ValOrd.intros(6))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1250
apply (metis ValOrd.intros(3) order_refl)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1251
apply(simp (no_asm) add: POSIX_def)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1252
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1253
apply (metis Prf.intros(3) v3)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1254
apply(rotate_tac 4)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1255
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1256
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1257
defer
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1258
apply (metis POSIX_ALT1a POSIX_def ValOrd.intros(5))
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1259
prefer 2
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1260
apply(subst (asm) (5) POSIX_def)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1261
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1262
apply(rotate_tac 5)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1263
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1264
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1265
apply(rule ValOrd.intros)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1266
apply(subst (asm) v4)
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1267
apply(simp)
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1268
apply(drule_tac x="Left (projval r1a c v1)" in spec)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1269
apply(clarify)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1270
apply(drule mp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1271
apply(rule conjI)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1272
apply (metis Prf.intros(2) v3_proj)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1273
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1274
apply (metis v4_proj2)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1275
apply(erule ValOrd.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1276
apply(simp_all)[8]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1277
apply (metis less_not_refl v4_proj2)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1278
(* seq case *)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1279
apply(case_tac "nullable r1")
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1280
defer
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1281
apply(simp add: POSIX_def)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1282
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1283
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1284
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1285
apply (metis Prf.intros(1) v3)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1286
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1287
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1288
apply(erule Prf.cases)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1289
apply(simp_all)[5]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1290
apply(clarify)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1291
apply(subst (asm) (3) v4)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1292
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1293
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1294
apply(subgoal_tac "flat v1a \<noteq> []")
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1295
prefer 2
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1296
apply (metis Prf_flat_L nullable_correctness)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1297
apply(subgoal_tac "\<exists>s. flat v1a = c # s")
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1298
prefer 2
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1299
apply (metis append_eq_Cons_conv)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1300
apply(auto)[1]
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1301
 
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1302
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1303
apply(auto)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1304
thm v3
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1305
apply (erule v3)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1306
thm v4
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1307
apply(subst (asm) v4)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1308
apply(assumption)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1309
apply(drule_tac x="projval r c v'" in spec)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1310
apply(drule mp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1311
apply(rule conjI)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1312
thm v3_proj
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1313
apply(rule v3_proj)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1314
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1315
apply(rule_tac x="flat v" in exI)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1316
apply(simp)
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1317
thm t
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1318
apply(rule_tac c="c" in  t)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1319
apply(simp)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1320
thm v4_proj
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1321
apply(subst v4_proj)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1322
apply(simp)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1323
apply(rule_tac x="flat v" in exI)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1324
apply(simp)
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1325
apply(simp)
75
f95a405c3180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 74
diff changeset
  1326
oops
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1327
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1328
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1329
lemma POSIX_ex: "\<turnstile> v : r \<Longrightarrow> \<exists>v. POSIX v r"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1330
apply(induct r arbitrary: v)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1331
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1332
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1333
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1334
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1335
apply(rule_tac x="Void" in exI)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1336
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1337
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1338
apply (metis Prf.intros(4))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1339
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1340
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1341
apply (metis ValOrd.intros(7))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1342
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1343
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1344
apply(rule_tac x="Char c" in exI)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1345
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1346
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1347
apply (metis Prf.intros(5))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1348
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1349
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1350
apply (metis ValOrd.intros(8))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1351
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1352
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1353
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1354
apply(drule_tac x="v1" in meta_spec)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1355
apply(drule_tac x="v2" in meta_spec)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1356
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1357
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1358
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1359
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1360
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1361
apply (metis POSIX_ALT_I1)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1362
apply (metis POSIX_ALT_I1 POSIX_ALT_I2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1363
apply(case_tac "nullable r1a")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1364
apply(rule_tac x="Seq (mkeps r1a) va" in exI)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1365
apply(auto simp add: POSIX_def)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1366
apply (metis Prf.intros(1) mkeps_nullable)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1367
apply(simp add: mkeps_flat)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1368
apply(rotate_tac 7)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1369
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1370
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1371
apply(case_tac "mkeps r1 = v1a")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1372
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1373
apply (rule ValOrd.intros(1))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1374
apply (metis append_Nil mkeps_flat)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1375
apply (rule ValOrd.intros(2))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1376
apply(drule mkeps_POSIX)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1377
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1378
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1379
apply metis
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1380
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1381
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1382
apply(erule disjE)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1383
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1384
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1385
apply(drule_tac x="v2" in spec)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1386
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1387
lemma POSIX_ex2: "\<turnstile> v : r \<Longrightarrow> \<exists>v. POSIX v r \<and> \<turnstile> v : r"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1388
apply(induct r arbitrary: v)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1389
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1390
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1391
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1392
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1393
apply(rule_tac x="Void" in exI)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1394
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1395
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1396
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1397
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1398
apply (metis ValOrd.intros(7))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1399
apply (metis Prf.intros(4))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1400
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1401
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1402
apply(rule_tac x="Char c" in exI)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1403
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1404
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1405
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1406
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1407
apply (metis ValOrd.intros(8))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1408
apply (metis Prf.intros(5))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1409
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1410
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1411
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1412
apply(drule_tac x="v1" in meta_spec)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1413
apply(drule_tac x="v2" in meta_spec)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1414
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1415
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1416
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1417
apply(rule ccontr)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1418
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1419
apply(drule_tac x="Seq v va" in spec)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1420
apply(drule mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1421
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1422
apply (metis Prf.intros(1))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1423
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1424
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1425
oops
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1426
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1427
lemma POSIX_ALT_cases:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1428
  assumes "\<turnstile> v : (ALT r1 r2)" "POSIX v (ALT r1 r2)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1429
  shows "(\<exists>v1. v = Left v1 \<and> POSIX v1 r1) \<or> (\<exists>v2. v = Right v2 \<and> POSIX v2 r2)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1430
using assms
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1431
apply(erule_tac Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1432
apply(simp_all)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1433
unfolding POSIX_def
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1434
apply(auto)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1435
apply (metis POSIX_ALT2 POSIX_def assms(2))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1436
by (metis POSIX_ALT1b assms(2))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1437
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1438
lemma POSIX_ALT_cases2:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1439
  assumes "POSIX v (ALT r1 r2)" "\<turnstile> v : (ALT r1 r2)" 
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1440
  shows "(\<exists>v1. v = Left v1 \<and> POSIX v1 r1) \<or> (\<exists>v2. v = Right v2 \<and> POSIX v2 r2)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1441
using assms POSIX_ALT_cases by auto
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1442
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1443
lemma Prf_flat_empty:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1444
  assumes "\<turnstile> v : r" "flat v = []"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1445
  shows "nullable r"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1446
using assms
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1447
apply(induct)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1448
apply(auto)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1449
done
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1450
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1451
lemma POSIX_proj:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1452
  assumes "POSIX v r" "\<turnstile> v : r" "\<exists>s. flat v = c#s"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1453
  shows "POSIX (projval r c v) (der c r)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1454
using assms
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1455
apply(induct r c v arbitrary: rule: projval.induct)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1456
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1457
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1458
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1459
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1460
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1461
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1462
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1463
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1464
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1465
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1466
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1467
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1468
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1469
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1470
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1471
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1472
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1473
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1474
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1475
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1476
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1477
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1478
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1479
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1480
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1481
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1482
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1483
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1484
apply (metis ValOrd.intros(7))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1485
apply(erule_tac [!] exE)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1486
prefer 3
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1487
apply(frule POSIX_SEQ1)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1488
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1489
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1490
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1491
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1492
apply(case_tac "flat v1 = []")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1493
apply(subgoal_tac "nullable r1")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1494
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1495
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1496
apply(rule_tac v="v1" in Prf_flat_empty)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1497
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1498
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1499
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1500
apply(frule POSIX_SEQ2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1501
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1502
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1503
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1504
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1505
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1506
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1507
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1508
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1509
apply(rule ccontr)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1510
apply(subgoal_tac "\<turnstile> val.Right (projval r2 c v2) : (ALT (SEQ (der c r1) r2) (der c r2))")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1511
apply(rotate_tac 11)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1512
apply(frule POSIX_ex)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1513
apply(erule exE)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1514
apply(drule POSIX_ALT_cases2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1515
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1516
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1517
apply(drule v3_proj)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1518
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1519
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1520
apply(drule POSIX_ex)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1521
apply(erule exE)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1522
apply(frule POSIX_ALT_cases2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1523
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1524
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1525
apply(erule 
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1526
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1527
apply(case_tac "nullable r1")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1528
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1529
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1530
apply(rotate_tac 1)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1531
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1532
apply(rule POSIX_SEQ1)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1533
apply(assumption)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1534
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1535
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1536
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1537
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1538
apply(rotate_tac 7)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1539
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1540
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1541
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1542
apply(rotate_tac 7)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1543
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1544
apply (metis Cons_eq_append_conv)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1545
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1546
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1547
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1548
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1549
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1550
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1551
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1552
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1553
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1554
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1555
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1556
lemma POSIX_proj:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1557
  assumes "POSIX v r" "\<turnstile> v : r" "\<exists>s. flat v = c#s"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1558
  shows "POSIX (projval r c v) (der c r)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1559
using assms
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1560
apply(induct r arbitrary: c v rule: rexp.induct)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1561
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1562
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1563
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1564
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1565
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1566
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1567
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1568
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1569
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1570
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1571
apply (metis ValOrd.intros(7))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1572
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1573
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1574
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1575
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1576
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1577
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1578
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1579
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1580
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1581
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1582
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1583
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1584
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1585
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1586
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1587
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1588
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1589
apply (metis ValOrd.intros(7))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1590
apply(erule_tac [!] exE)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1591
prefer 3
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1592
apply(frule POSIX_SEQ1)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1593
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1594
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1595
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1596
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1597
apply(case_tac "flat v1 = []")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1598
apply(subgoal_tac "nullable r1")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1599
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1600
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1601
apply(rule_tac v="v1" in Prf_flat_empty)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1602
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1603
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1604
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1605
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1606
lemma POSIX_proj:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1607
  assumes "POSIX v r" "\<turnstile> v : r" "\<exists>s. flat v = c#s"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1608
  shows "POSIX (projval r c v) (der c r)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1609
using assms
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1610
apply(induct r c v arbitrary: rule: projval.induct)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1611
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1612
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1613
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1614
defer
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1615
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1616
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1617
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1618
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1619
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1620
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1621
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1622
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1623
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1624
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1625
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1626
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1627
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1628
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1629
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1630
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1631
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1632
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1633
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1634
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1635
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1636
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1637
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1638
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1639
apply (metis ValOrd.intros(7))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1640
apply(erule_tac [!] exE)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1641
prefer 3
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1642
apply(frule POSIX_SEQ1)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1643
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1644
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1645
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1646
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1647
apply(case_tac "flat v1 = []")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1648
apply(subgoal_tac "nullable r1")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1649
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1650
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1651
apply(rule_tac v="v1" in Prf_flat_empty)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1652
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1653
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1654
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1655
apply(rule ccontr)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1656
apply(drule v3_proj)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1657
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1658
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1659
apply(drule POSIX_ex)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1660
apply(erule exE)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1661
apply(frule POSIX_ALT_cases2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1662
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1663
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1664
apply(erule 
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1665
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1666
apply(case_tac "nullable r1")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1667
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1668
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1669
apply(rotate_tac 1)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1670
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1671
apply(rule POSIX_SEQ1)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1672
apply(assumption)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1673
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1674
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1675
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1676
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1677
apply(rotate_tac 7)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1678
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1679
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1680
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1681
apply(rotate_tac 7)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1682
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1683
apply (metis Cons_eq_append_conv)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1684
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1685
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1686
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1687
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1688
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1689
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1690
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1691
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1692
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1693
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1694
done
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1695
(* NULL case *)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1696
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1697
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1698
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1699
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1700
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1701
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1702
apply (metis ValOrd.intros(7))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1703
apply(rotate_tac 4)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1704
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1705
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1706
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1707
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1708
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1709
apply(frule POSIX_ALT1a)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1710
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1711
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1712
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1713
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1714
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1715
apply(rule POSIX_ALT_I2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1716
apply(assumption)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1717
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1718
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1719
thm v4_proj2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1720
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1721
apply(subst (asm) (13) POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1722
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1723
apply(drule_tac x="projval v2" in spec)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1724
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1725
apply(drule mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1726
apply(rule conjI)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1727
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1728
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1729
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1730
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1731
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1732
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1733
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1734
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1735
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1736
apply(subst (asm) (2) POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1737
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1738
apply (metis ValOrd.intros(5))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1739
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1740
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1741
apply(rotate_tac 3)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1742
apply(drule_tac c="c" in t2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1743
apply(subst (asm) v4_proj)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1744
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1745
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1746
thm contrapos_np contrapos_nn
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1747
apply(erule contrapos_np)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1748
apply(rule ValOrd.intros)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1749
apply(subst  v4_proj2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1750
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1751
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1752
apply(subgoal_tac "\<not>(length (flat v1) < length (flat (projval r2a c v2a)))")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1753
prefer 2
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1754
apply(erule contrapos_nn)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1755
apply (metis nat_less_le v4_proj2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1756
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1757
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1758
apply(blast)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1759
thm contrapos_nn
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1760
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1761
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1762
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1763
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1764
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1765
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1766
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1767
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1768
apply(rule ValOrd.intros)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1769
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1770
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1771
apply (metis POSIX_ALT2 POSIX_def flat.simps(3))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1772
apply metis
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1773
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1774
apply(rule ValOrd.intros)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1775
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1776
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1777
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1778
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1779
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1780
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1781
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1782
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1783
apply(rule ValOrd.intros)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1784
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1785
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1786
apply(drule meta_mp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1787
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1788
apply (metis POSIX_ALT2 POSIX_def flat.simps(3))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1789
apply metis
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1790
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1791
apply(rule ValOrd.intros)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1792
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1793
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1794
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1795
done
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1796
(* EMPTY case *)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1797
apply(simp add: POSIX_def)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1798
apply(auto)[1]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1799
apply(rotate_tac 3)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1800
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1801
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1802
apply(drule_tac c="c" in t2)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1803
apply(subst (asm) v4_proj)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1804
apply(auto)[2]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1805
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1806
apply(erule ValOrd.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1807
apply(simp_all)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1808
(* CHAR case *)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1809
apply(case_tac "c = c'")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1810
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1811
apply(erule ValOrd.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1812
apply(simp_all)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1813
apply(rule ValOrd.intros)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1814
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1815
apply(erule ValOrd.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1816
apply(simp_all)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1817
(* ALT case *)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1818
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1819
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1820
unfolding POSIX_def
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1821
apply(auto)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1822
thm v4
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1823
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1824
lemma Prf_inj:
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1825
  assumes "v1 \<succ>(der c r) v2" "\<turnstile> v1 : der c r" "\<turnstile> v2 : der c r" "flat v1 = flat v2"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1826
  shows "(injval r c v1) \<succ>r (injval r c v2)"
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1827
using assms
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1828
apply(induct arbitrary: v1 v2 rule: der.induct)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1829
(* NULL case *)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1830
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1831
apply(erule ValOrd.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1832
apply(simp_all)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1833
(* EMPTY case *)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1834
apply(erule ValOrd.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1835
apply(simp_all)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1836
(* CHAR case *)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1837
apply(case_tac "c = c'")
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1838
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1839
apply(erule ValOrd.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1840
apply(simp_all)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1841
apply(rule ValOrd.intros)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1842
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1843
apply(erule ValOrd.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1844
apply(simp_all)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1845
(* ALT case *)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1846
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1847
apply(erule ValOrd.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1848
apply(simp_all)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1849
apply(rule ValOrd.intros)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1850
apply(subst v4)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1851
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1852
apply(rotate_tac 3)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1853
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1854
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1855
apply(subst v4)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1856
apply(clarify)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1857
apply(rotate_tac 2)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1858
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1859
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1860
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1861
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1862
apply(clarify)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1863
apply(rotate_tac 3)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1864
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1865
apply(simp_all)[5]
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1866
apply(clarify)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1867
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1868
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1869
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1870
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1871
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1872
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1873
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1874
apply(simp_all)[5]
55
c33cfa1e813a added some notes (still incomplete)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 53
diff changeset
  1875
(* SEQ case*)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1876
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1877
apply(case_tac "nullable r1")
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1878
defer
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1879
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1880
apply(erule ValOrd.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1881
apply(simp_all)[8]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1882
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1883
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1884
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1885
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1886
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1887
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1888
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1889
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1890
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1891
apply(rule ValOrd.intros(2))
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1892
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1893
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1894
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1895
apply(simp_all)[5]
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1896
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1897
defer
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1898
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1899
apply(erule ValOrd.cases)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1900
apply(simp_all del: injval.simps)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1901
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1902
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1903
apply(simp)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1904
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1905
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1906
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1907
apply(simp_all)[5]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1908
apply(clarify)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1909
apply(erule Prf.cases)
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1910
apply(simp_all)[5]
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1911
apply(clarify)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1912
apply(rule ValOrd.intros(2))
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1913
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1914
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1915
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1916
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1917
done
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1918
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1919
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1920
txt {*
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1921
done
55
c33cfa1e813a added some notes (still incomplete)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 53
diff changeset
  1922
(* nullable case - unfinished *)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1923
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1924
apply(erule ValOrd.cases)
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1925
apply(simp_all del: injval.simps)[8]
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1926
apply(simp)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1927
apply(clarify)
55
c33cfa1e813a added some notes (still incomplete)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 53
diff changeset
  1928
apply(simp)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1929
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1930
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1931
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1932
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1933
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1934
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1935
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1936
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1937
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1938
apply(rule ValOrd.intros(2))
62
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1939
oops
a6bb0152ccc2 updated some rules
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 56
diff changeset
  1940
*}
55
c33cfa1e813a added some notes (still incomplete)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 53
diff changeset
  1941
oops
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1942
74
dfa9dbb8f8e6 updated from the session today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 73
diff changeset
  1943
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  1944
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1945
text {*
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1946
  Injection followed by projection is the identity.
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1947
*}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1948
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1949
lemma proj_inj_id:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1950
  assumes "\<turnstile> v : der c r" 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1951
  shows "projval r c (injval r c v) = v"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1952
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1953
apply(induct r arbitrary: c v rule: rexp.induct)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1954
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1955
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1956
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1957
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1958
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1959
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1960
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1961
apply(case_tac "c = char")
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1962
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1963
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1964
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1965
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1966
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1967
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1968
defer
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1969
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1970
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1971
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1972
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1973
apply(case_tac "nullable rexp1")
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1974
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1975
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1976
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1977
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1978
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1979
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1980
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1981
apply (metis list.distinct(1) v4)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1982
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1983
apply (metis mkeps_flat)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1984
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1985
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1986
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1987
apply(auto)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1988
apply(simp add: v4)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1989
done
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1990
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  1991
lemma "L r \<noteq> {} \<Longrightarrow> \<exists>v. POSIX3 v r"
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  1992
apply(induct r)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  1993
apply(simp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  1994
apply(simp add: POSIX3_def)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  1995
apply(rule_tac x="Void" in exI)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  1996
apply(auto)[1]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  1997
apply (metis Prf.intros(4))
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  1998
apply (metis POSIX3_def flat.simps(1) mkeps.simps(1) mkeps_POSIX3 nullable.simps(2) order_refl)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  1999
apply(simp add: POSIX3_def)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2000
apply(rule_tac x="Char char" in exI)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2001
apply(auto)[1]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2002
apply (metis Prf.intros(5))
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2003
apply(erule Prf.cases)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2004
apply(simp_all)[5]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2005
apply (metis ValOrd.intros(8))
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2006
apply(simp add: Sequ_def)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2007
apply(auto)[1]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2008
apply(drule meta_mp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2009
apply(auto)[2]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2010
apply(drule meta_mp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2011
apply(auto)[2]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2012
apply(rule_tac x="Seq v va" in exI)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2013
apply(simp (no_asm) add: POSIX3_def)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2014
apply(auto)[1]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2015
apply (metis POSIX3_def Prf.intros(1))
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2016
apply(erule Prf.cases)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2017
apply(simp_all)[5]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2018
apply(clarify)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2019
apply(case_tac "v  \<succ>r1a v1")
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2020
apply(rule ValOrd.intros(2))
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2021
apply(simp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2022
apply(case_tac "v = v1")
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2023
apply(rule ValOrd.intros(1))
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2024
apply(simp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2025
apply(simp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2026
apply (metis ValOrd_refl)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2027
apply(simp add: POSIX3_def)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2028
oops
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2029
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2030
lemma "\<exists>v. POSIX v r"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2031
apply(induct r)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2032
apply(rule exI)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2033
apply(simp add: POSIX_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2034
apply (metis (full_types) Prf_flat_L der.simps(1) der.simps(2) der.simps(3) flat.simps(1) nullable.simps(1) nullable_correctness proj_inj_id projval.simps(1) v3 v4)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2035
apply(rule_tac x = "Void" in exI)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2036
apply(simp add: POSIX_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2037
apply (metis POSIX_def flat.simps(1) mkeps.simps(1) mkeps_POSIX nullable.simps(2))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2038
apply(rule_tac x = "Char char" in exI)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2039
apply(simp add: POSIX_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2040
apply(auto) [1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2041
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2042
apply(simp_all) [5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2043
apply (metis ValOrd.intros(8))
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2044
defer
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2045
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2046
apply (metis POSIX_ALT_I1)
11
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
  2047
(* maybe it is too early to instantiate this existential quantifier *)
26b8a5213355 changed theory name
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 10
diff changeset
  2048
(* potentially this is the wrong POSIX value *)
20
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2049
apply(case_tac "r1 = NULL")
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2050
apply(simp add: POSIX_def)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2051
apply(auto)[1]
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2052
apply (metis L.simps(1) L.simps(4) Prf_flat_L mkeps_flat nullable.simps(1) nullable.simps(2) nullable_correctness seq_null(2))
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2053
apply(case_tac "r1 = EMPTY")
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2054
apply(rule_tac x = "Seq Void va" in exI )
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2055
apply(simp (no_asm) add: POSIX_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2056
apply(auto)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2057
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2058
apply(simp_all)
20
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2059
apply(auto)[1]
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2060
apply(erule Prf.cases)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2061
apply(simp_all)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2062
apply(rule ValOrd.intros(2))
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2063
apply(rule ValOrd.intros)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2064
apply(case_tac "\<exists>c. r1 = CHAR c")
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2065
apply(auto)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2066
apply(rule_tac x = "Seq (Char c) va" in exI )
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2067
apply(simp (no_asm) add: POSIX_def)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2068
apply(auto)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2069
apply(erule Prf.cases)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2070
apply(simp_all)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2071
apply(auto)[1]
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2072
apply(erule Prf.cases)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2073
apply(simp_all)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2074
apply(auto)[1]
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2075
apply(rule ValOrd.intros(2))
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2076
apply(rule ValOrd.intros)
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2077
apply(case_tac "\<exists>r1a r1b. r1 = ALT r1a r1b")
c11651bbebf5 some small changes
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 12
diff changeset
  2078
apply(auto)
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2079
oops (* not sure if this can be proved by induction *)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2080
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2081
text {* 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2082
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2083
  HERE: Crucial lemma that does not go through in the sequence case. 
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2084
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2085
*}
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2086
lemma v5:
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2087
  assumes "\<turnstile> v : der c r" "POSIX v (der c r)"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2088
  shows "POSIX (injval r c v) r"
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2089
using assms
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2090
apply(induct arbitrary: v rule: der.induct)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2091
(* NULL case *)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2092
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2093
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2094
apply(simp_all)[5]
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2095
(* EMPTY case *)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2096
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2097
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2098
apply(simp_all)[5]
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2099
(* CHAR case *)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2100
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2101
apply(case_tac "c = c'")
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2102
apply(auto simp add: POSIX_def)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2103
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2104
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2105
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2106
apply(simp_all)[5]
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2107
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2108
apply(auto)[1]
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2109
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2110
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2111
(* base cases done *)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2112
(* ALT case *)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2113
apply(erule Prf.cases)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2114
apply(simp_all)[5]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2115
using POSIX_ALT POSIX_ALT_I1 apply blast
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2116
apply(clarify)
53
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2117
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2118
apply(rule POSIX_ALT_I2)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2119
apply(drule POSIX_ALT1a)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2120
apply metis
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2121
apply(auto)[1]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2122
apply(subst v4)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2123
apply(assumption)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2124
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2125
apply(drule POSIX_ALT1a)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2126
apply(rotate_tac 1)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2127
apply(drule_tac x="v2" in meta_spec)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2128
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2129
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2130
apply(rotate_tac 4)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2131
apply(erule Prf.cases)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2132
apply(simp_all)[5]
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2133
apply(rule ValOrd.intros)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2134
apply(simp)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2135
apply(subst (asm) v4)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2136
apply(assumption)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2137
apply(clarify)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2138
thm POSIX_ALT1a POSIX_ALT1b POSIX_ALT_I2
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2139
apply(subst (asm) v4)
38cde0214ad5 added some lemmas, attempted others
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 49
diff changeset
  2140
apply(auto simp add: POSIX_def)[1]
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2141
apply(subgoal_tac "POSIX v2 (der c r2)")
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2142
prefer 2
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2143
apply(auto simp add: POSIX_def)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2144
apply (metis POSIX_ALT1a POSIX_def flat.simps(4))
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2145
apply(frule POSIX_ALT1a)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2146
apply(drule POSIX_ALT1b)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2147
apply(rule POSIX_ALT_I2)
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2148
apply(rotate_tac 1)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2149
apply(drule_tac x="v2" in meta_spec)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2150
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2151
apply(subgoal_tac "\<turnstile> Right (injval r2 c v2) : (ALT r1 r2)")
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2152
prefer 2
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2153
apply (metis Prf.intros(3) v3)
48
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2154
apply auto[1]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2155
apply(subst v4)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2156
apply(auto)[2]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2157
apply(subst (asm) (4) POSIX_def)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2158
apply(subst (asm) v4)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2159
apply(drule_tac x="v2" in meta_spec)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2160
apply(simp)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2161
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2162
apply(auto)[2]
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2163
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2164
thm POSIX_ALT_I2
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2165
apply(rule POSIX_ALT_I2)
652861c9473f added a function for calculating values
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 20
diff changeset
  2166
10
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2167
apply(rule ccontr)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2168
apply(auto simp add: POSIX_def)[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2169
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2170
apply(rule allI)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2171
apply(rule impI)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2172
apply(erule conjE)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2173
thm POSIX_ALT_I2
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2174
apply(frule POSIX_ALT1a)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2175
apply(drule POSIX_ALT1b)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2176
apply(rule POSIX_ALT_I2)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2177
apply auto[1]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2178
apply(subst v4)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2179
apply(auto)[2]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2180
apply(rotate_tac 1)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2181
apply(drule_tac x="v2" in meta_spec)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2182
apply(simp)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2183
apply(subst (asm) (4) POSIX_def)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2184
apply(subst (asm) v4)
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2185
apply(auto)[2]
14d41b5b57b3 added test version
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  2186
(* stuck in the ALT case *)