thys/Simplifying.thy
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 14 Mar 2016 23:08:58 +0000
changeset 150 09f81fee11ce
child 151 5a1196466a9c
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
150
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
theory Simplifying
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
  imports "ReStar" 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
begin
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
section {* Lexer including simplifications *}
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
fun F_RIGHT where
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
  "F_RIGHT f v = Right (f v)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
fun F_LEFT where
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
  "F_LEFT f v = Left (f v)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
fun F_ALT where
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
  "F_ALT f\<^sub>1 f\<^sub>2 (Right v) = Right (f\<^sub>2 v)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
| "F_ALT f\<^sub>1 f\<^sub>2 (Left v) = Left (f\<^sub>1 v)"  
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
| "F_ALT f1 f2 v = v"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
fun F_SEQ1 where
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
  "F_SEQ1 f\<^sub>1 f\<^sub>2 v = Seq (f\<^sub>1 Void) (f\<^sub>2 v)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
fun F_SEQ2 where 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
  "F_SEQ2 f\<^sub>1 f\<^sub>2 v = Seq (f\<^sub>1 v) (f\<^sub>2 Void)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    25
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    26
fun F_SEQ where 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    27
  "F_SEQ f\<^sub>1 f\<^sub>2 (Seq v\<^sub>1 v\<^sub>2) = Seq (f\<^sub>1 v\<^sub>1) (f\<^sub>2 v\<^sub>2)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
| "F_SEQ f1 f2 v = v"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
fun simp_ALT where
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
  "simp_ALT (ZERO, f\<^sub>1) (r\<^sub>2, f\<^sub>2) = (r\<^sub>2, F_RIGHT f\<^sub>2)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
| "simp_ALT (r\<^sub>1, f\<^sub>1) (ZERO, f\<^sub>2) = (r\<^sub>1, F_LEFT f\<^sub>1)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
| "simp_ALT (r\<^sub>1, f\<^sub>1) (r\<^sub>2, f\<^sub>2) = (ALT r\<^sub>1 r\<^sub>2, F_ALT f\<^sub>1 f\<^sub>2)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    34
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
fun simp_SEQ where
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    36
  "simp_SEQ (ONE, f\<^sub>1) (r\<^sub>2, f\<^sub>2) = (r\<^sub>2, F_SEQ1 f\<^sub>1 f\<^sub>2)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    37
| "simp_SEQ (r\<^sub>1, f\<^sub>1) (ONE, f\<^sub>2) = (r\<^sub>1, F_SEQ2 f\<^sub>1 f\<^sub>2)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    38
| "simp_SEQ (r\<^sub>1, f\<^sub>1) (r\<^sub>2, f\<^sub>2) = (SEQ r\<^sub>1 r\<^sub>2, F_SEQ f\<^sub>1 f\<^sub>2)"  
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
lemma simp_SEQ_simps:
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
  "simp_SEQ p1 p2 = (if (fst p1 = ONE) then (fst p2, F_SEQ1 (snd p1) (snd p2))
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
                    else (if (fst p2 = ONE) then (fst p1, F_SEQ2 (snd p1) (snd p2))
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    43
                    else (SEQ (fst p1) (fst p2), F_SEQ (snd p1) (snd p2))))"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    44
apply(auto)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
apply(case_tac p1)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
apply(case_tac p2)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    47
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    48
apply(case_tac p1)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
apply(case_tac p2)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    51
apply(case_tac a)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    53
apply(case_tac p1)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
apply(case_tac p2)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    55
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    56
apply(case_tac p1)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
apply(case_tac p2)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    59
apply(case_tac a)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    60
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    61
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    62
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    63
apply(auto)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    64
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    65
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    68
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    69
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    70
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    71
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    72
done
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    73
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    74
lemma simp_ALT_simps:
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    75
  "simp_ALT p1 p2 = (if (fst p1 = ZERO) then (fst p2, F_RIGHT (snd p2))
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    76
                    else (if (fst p2 = ZERO) then (fst p1, F_LEFT (snd p1))
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    77
                    else (ALT (fst p1) (fst p2), F_ALT (snd p1) (snd p2))))"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    78
apply(auto)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    79
apply(case_tac p1)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    80
apply(case_tac p2)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    81
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    82
apply(case_tac p1)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    83
apply(case_tac p2)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    84
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    85
apply(case_tac a)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    86
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    87
apply(case_tac p1)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    88
apply(case_tac p2)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    89
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    90
apply(case_tac p1)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    91
apply(case_tac p2)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    92
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    93
apply(case_tac a)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    94
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    95
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    96
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    97
apply(auto)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    98
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    99
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   100
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   101
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   102
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   103
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   104
apply(case_tac aa)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   105
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   106
done
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   107
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   108
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   109
fun 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   110
  simp :: "rexp \<Rightarrow> rexp * (val \<Rightarrow> val)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   111
where
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   112
  "simp (ALT r1 r2) = simp_ALT (simp r1) (simp r2)" 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   113
| "simp (SEQ r1 r2) = simp_SEQ (simp r1) (simp r2)" 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   114
| "simp r = (r, id)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   115
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   116
fun 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   117
  slexer :: "rexp \<Rightarrow> string \<Rightarrow> val option"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   118
where
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   119
  "slexer r [] = (if nullable r then Some(mkeps r) else None)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   120
| "slexer r (c#s) = (let (rs, fr) = simp (der c r) in
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   121
                         (case (slexer rs s) of  
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   122
                            None \<Rightarrow> None
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   123
                          | Some(v) \<Rightarrow> Some(injval r c (fr v))))"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   124
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   125
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   126
lemma L_fst_simp:
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   127
  shows "L(r) = L(fst (simp r))"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   128
using assms
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   129
apply(induct r rule: rexp.induct)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   130
apply(auto simp add: simp_SEQ_simps simp_ALT_simps)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   131
done
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   132
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   133
lemma 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   134
  shows "\<turnstile> ((snd (simp r)) v) : r \<longleftrightarrow> \<turnstile> v : (fst (simp r))"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   135
using assms
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   136
apply(induct r arbitrary: v rule: simp.induct)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   137
apply(auto simp add: simp_SEQ_simps simp_ALT_simps intro: Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   138
using Prf_elims(3) apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   139
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   140
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   141
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   142
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   143
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   144
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   145
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   146
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   147
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   148
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   149
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   150
apply(case_tac v)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   151
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   152
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   153
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   154
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   155
apply(case_tac v)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   156
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   157
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   158
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   159
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   160
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   161
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   162
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   163
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   164
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   165
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   166
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   167
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   168
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   169
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   170
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   171
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   172
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   173
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   174
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   175
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   176
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   177
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   178
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   179
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   180
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   181
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   182
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   183
using Prf.intros(4) apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   184
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   185
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   186
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   187
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   188
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   189
using Prf.intros(4) apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   190
apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   191
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   192
apply(case_tac v)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   193
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   194
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   195
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   196
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   197
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   198
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   199
apply(erule Prf_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   200
apply(case_tac v)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   201
apply(simp_all)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   202
apply(rule Prf.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   203
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   204
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   205
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   206
done
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   207
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   208
lemma Posix_simp_nullable:
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   209
  assumes "nullable r" "[] \<in> (fst (simp r)) \<rightarrow> v"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   210
  shows "((snd (simp r)) v) = mkeps r"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   211
using assms 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   212
apply(induct r arbitrary: v)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   213
apply(auto simp add: simp_SEQ_simps simp_ALT_simps)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   214
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   215
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   216
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   217
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   218
using Posix.intros(1) apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   219
using Posix.intros(1) apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   220
using Posix.intros(1) apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   221
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   222
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   223
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   224
apply (metis L_fst_simp nullable.simps(1) nullable_correctness)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   225
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   226
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   227
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   228
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   229
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   230
apply(simp only: L_fst_simp[symmetric])
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   231
apply (simp add: nullable_correctness)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   232
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   233
using L_fst_simp Posix1(1) nullable_correctness apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   234
apply (metis L.simps(1) L_fst_simp Prf_flat_L empty_iff mkeps_nullable)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   235
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   236
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   237
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   238
apply(simp only: L_fst_simp[symmetric])
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   239
apply (simp add: nullable_correctness)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   240
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   241
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   242
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   243
using L_fst_simp Posix1(1) nullable_correctness apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   244
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   245
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   246
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   247
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   248
using Posix1(2) apply auto[1]
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   249
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   250
done
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   251
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   252
lemma Posix_simp:
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   253
  assumes "s \<in> (fst (simp r)) \<rightarrow> v" 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   254
  shows "s \<in> r \<rightarrow> ((snd (simp r)) v)"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   255
using assms
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   256
apply(induct r arbitrary: s v rule: rexp.induct) 
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   257
apply(auto split: if_splits simp add: simp_SEQ_simps simp_ALT_simps)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   258
prefer 3
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   259
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   260
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   261
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   262
apply(rule Posix.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   263
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   264
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   265
apply(auto)[1]
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   266
apply(simp add: L_fst_simp[symmetric])
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   267
apply(auto)[1]
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   268
prefer 3
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   269
apply(rule Posix.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   270
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   271
apply (metis L.simps(1) L_fst_simp equals0D)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   272
prefer 3
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   273
apply(rule Posix.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   274
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   275
prefer 3
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   276
apply(erule Posix_elims)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   277
apply(clarify)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   278
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   279
apply(rule Posix.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   280
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   281
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   282
apply(rule Posix.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   283
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   284
apply(simp add: L_fst_simp[symmetric])
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   285
apply(subst append.simps[symmetric])
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   286
apply(rule Posix.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   287
prefer 2
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   288
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   289
prefer 2
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   290
apply(auto)[1]
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   291
apply (metis L_fst_simp Posix_elims(2) lex_correct3a)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   292
apply(subst Posix_simp_nullable)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   293
using Posix.intros(1) Posix1(1) nullable_correctness apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   294
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   295
apply(rule Posix.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   296
apply(rule Posix_mkeps)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   297
using Posix.intros(1) Posix1(1) nullable_correctness apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   298
apply(subst append_Nil2[symmetric])
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   299
apply(rule Posix.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   300
apply(blast)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   301
apply(subst Posix_simp_nullable)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   302
using Posix.intros(1) Posix1(1) nullable_correctness apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   303
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   304
apply(rule Posix.intros)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   305
apply(rule Posix_mkeps)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   306
using Posix.intros(1) Posix1(1) nullable_correctness apply blast
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   307
apply(auto)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   308
done
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   309
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   310
lemma slexer_correctness:
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   311
  shows "slexer r s = lexer r s"
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   312
apply(induct s arbitrary: r)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   313
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   314
apply(simp)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   315
apply(auto split: option.split prod.split)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   316
apply (metis L_fst_simp fst_conv lex_correct1a)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   317
using L_fst_simp lex_correct1a apply fastforce
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   318
by (metis Posix_determ Posix_simp fst_conv lex_correct1 lex_correct3a option.distinct(1) option.inject snd_conv)
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   319
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   320
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   321
09f81fee11ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   322
end