thys2/ClosedForms.thy
author Chengsong
Sat, 19 Mar 2022 10:36:52 +0000
changeset 453 d68b9db4c9ec
parent 451 7a016eeb118d
child 456 26a5e640cdd7
permissions -rw-r--r--
all
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
     1
theory ClosedForms imports
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
     2
"BasicIdentities"
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
     3
begin
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
     4
453
Chengsong
parents: 451
diff changeset
     5
lemma add0_isomorphic:
Chengsong
parents: 451
diff changeset
     6
  shows "rsimp_ALTs (rdistinct (rflts [rsimp r, RZERO]) {}) = rsimp r"
Chengsong
parents: 451
diff changeset
     7
  sorry
Chengsong
parents: 451
diff changeset
     8
Chengsong
parents: 451
diff changeset
     9
Chengsong
parents: 451
diff changeset
    10
lemma distinct_append_simp:
Chengsong
parents: 451
diff changeset
    11
  shows " rsimp (rsimp_ALTs rs1) = rsimp (rsimp_ALTs rs2) \<Longrightarrow>
Chengsong
parents: 451
diff changeset
    12
           rsimp (rsimp_ALTs (f a # rs1)) =
Chengsong
parents: 451
diff changeset
    13
           rsimp (rsimp_ALTs (f a # rs2))"
Chengsong
parents: 451
diff changeset
    14
  apply(case_tac rs1)
Chengsong
parents: 451
diff changeset
    15
   apply simp
Chengsong
parents: 451
diff changeset
    16
   apply(case_tac rs2)
Chengsong
parents: 451
diff changeset
    17
    apply simp
Chengsong
parents: 451
diff changeset
    18
   apply simp
Chengsong
parents: 451
diff changeset
    19
   prefer 2
Chengsong
parents: 451
diff changeset
    20
   apply(case_tac list)
Chengsong
parents: 451
diff changeset
    21
    apply(case_tac rs2)
Chengsong
parents: 451
diff changeset
    22
     apply simp
Chengsong
parents: 451
diff changeset
    23
  using add0_isomorphic apply blast 
Chengsong
parents: 451
diff changeset
    24
    apply simp
Chengsong
parents: 451
diff changeset
    25
  sorry
Chengsong
parents: 451
diff changeset
    26
Chengsong
parents: 451
diff changeset
    27
(*  apply (smt (z3) append.right_neutral empty_iff list.distinct(1) list.inject no_alt_short_list_after_simp no_further_dB_after_simp rdistinct.elims rflts.elims rflts.simps(2) rsimp_ALTs.simps(1) rsimp_ALTs.simps(2)))*)
Chengsong
parents: 451
diff changeset
    28
Chengsong
parents: 451
diff changeset
    29
Chengsong
parents: 451
diff changeset
    30
451
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    31
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    32
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    33
lemma simp_rdistinct_f: shows 
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    34
"f ` rset = frset \<Longrightarrow> rsimp (rsimp_ALTs (map f (rdistinct rs rset))) = rsimp (rsimp_ALTs (rdistinct (map f rs) frset))  "
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    35
  apply(induct rs arbitrary: rset)
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    36
   apply simp
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    37
   apply(case_tac "a \<in> rset")
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    38
  apply(case_tac " f a \<in> frset")
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    39
   apply simp
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    40
   apply blast
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    41
  apply(subgoal_tac "f a \<notin> frset")
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    42
   apply(simp)
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    43
   apply(subgoal_tac "f ` (insert a rset) = insert (f a) frset")
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    44
  prefer 2
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    45
  apply (meson image_insert)
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    46
  
453
Chengsong
parents: 451
diff changeset
    47
  oops
451
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
    48
453
Chengsong
parents: 451
diff changeset
    49
lemma spawn_simp_rsimpalts:
Chengsong
parents: 451
diff changeset
    50
  shows "rsimp (rsimp_ALTs rs) = rsimp (rsimp_ALTs (map rsimp rs))"
Chengsong
parents: 451
diff changeset
    51
  apply(cases rs)
Chengsong
parents: 451
diff changeset
    52
   apply simp
Chengsong
parents: 451
diff changeset
    53
  apply(case_tac list)
Chengsong
parents: 451
diff changeset
    54
   apply simp
Chengsong
parents: 451
diff changeset
    55
   apply(subst rsimp_idem[symmetric])
Chengsong
parents: 451
diff changeset
    56
   apply simp
Chengsong
parents: 451
diff changeset
    57
  apply(subgoal_tac "rsimp_ALTs rs = RALTS rs")
Chengsong
parents: 451
diff changeset
    58
   apply(simp only:)
Chengsong
parents: 451
diff changeset
    59
   apply(subgoal_tac "rsimp_ALTs (map rsimp rs) = RALTS (map rsimp rs)")
Chengsong
parents: 451
diff changeset
    60
    apply(simp only:)
Chengsong
parents: 451
diff changeset
    61
  prefer 2
Chengsong
parents: 451
diff changeset
    62
  apply simp
Chengsong
parents: 451
diff changeset
    63
   prefer 2
Chengsong
parents: 451
diff changeset
    64
  using rsimp_ALTs.simps(3) apply presburger
Chengsong
parents: 451
diff changeset
    65
  apply auto
Chengsong
parents: 451
diff changeset
    66
  apply(subst rsimp_idem)+
Chengsong
parents: 451
diff changeset
    67
  by (metis comp_apply rsimp_idem)
Chengsong
parents: 451
diff changeset
    68
Chengsong
parents: 451
diff changeset
    69
lemma spawn_simp_distinct:
Chengsong
parents: 451
diff changeset
    70
  shows "rsimp (rsimp_ALTs (rsa @ (rdistinct rs (set rsa)))) = rsimp (rsimp_ALTs (rsa @ rs))
Chengsong
parents: 451
diff changeset
    71
\<and> (a1 \<in> set rsa1 \<longrightarrow> rsimp (rsimp_ALTs (rsa1 @ rs)) = rsimp (rsimp_ALTs (rsa1 @ a1 # rs)))
Chengsong
parents: 451
diff changeset
    72
\<and> rsimp  (rsimp_ALTs (rsc @ rs)) = rsimp (rsimp_ALTs (rsc @ (rdistinct rs (set rsc))))"
Chengsong
parents: 451
diff changeset
    73
  apply(induct rs arbitrary: rsa rsa1 a1 rsc)
Chengsong
parents: 451
diff changeset
    74
   apply simp
Chengsong
parents: 451
diff changeset
    75
   apply(subgoal_tac "rsimp (rsimp_ALTs (rsa1 @ [a1])) = rsimp (rsimp_ALTs (rsa1 @ (rdistinct [a1] (set rsa1))))")
Chengsong
parents: 451
diff changeset
    76
  prefer 2
Chengsong
parents: 451
diff changeset
    77
  
Chengsong
parents: 451
diff changeset
    78
Chengsong
parents: 451
diff changeset
    79
Chengsong
parents: 451
diff changeset
    80
Chengsong
parents: 451
diff changeset
    81
  oops
Chengsong
parents: 451
diff changeset
    82
Chengsong
parents: 451
diff changeset
    83
lemma inv_one_derx:
Chengsong
parents: 451
diff changeset
    84
  shows " RONE = rder xa r2 \<Longrightarrow> r2 = RCHAR xa"
Chengsong
parents: 451
diff changeset
    85
  apply(case_tac r2)
Chengsong
parents: 451
diff changeset
    86
       apply simp+
Chengsong
parents: 451
diff changeset
    87
  
Chengsong
parents: 451
diff changeset
    88
  using rrexp.distinct(1) apply presburger
Chengsong
parents: 451
diff changeset
    89
    apply (metis rder.simps(5) rrexp.distinct(13) rrexp.simps(20))
Chengsong
parents: 451
diff changeset
    90
  
Chengsong
parents: 451
diff changeset
    91
   apply simp+
Chengsong
parents: 451
diff changeset
    92
  done
Chengsong
parents: 451
diff changeset
    93
Chengsong
parents: 451
diff changeset
    94
lemma shape_of_derseq:
Chengsong
parents: 451
diff changeset
    95
  shows "rder x (RSEQ r1 r2) = RSEQ (rder x r1) r2 \<or> rder x (RSEQ r1 r2) = (RALT (RSEQ (rder x r1) r2) (rder x r2))"
Chengsong
parents: 451
diff changeset
    96
  using rder.simps(5) by presburger
Chengsong
parents: 451
diff changeset
    97
lemma shape_of_derseq2:
Chengsong
parents: 451
diff changeset
    98
  shows "rder x (RSEQ r11 r12) = RSEQ x41 x42 \<Longrightarrow> x41 = rder x r11"
Chengsong
parents: 451
diff changeset
    99
  by (metis rrexp.distinct(25) rrexp.inject(2) shape_of_derseq)
Chengsong
parents: 451
diff changeset
   100
Chengsong
parents: 451
diff changeset
   101
lemma alts_preimage_case1:
Chengsong
parents: 451
diff changeset
   102
  shows "rder x r = RALTS [r] \<Longrightarrow> \<exists>ra. r = RALTS [ra]"
Chengsong
parents: 451
diff changeset
   103
  apply(case_tac r)
Chengsong
parents: 451
diff changeset
   104
       apply simp+
Chengsong
parents: 451
diff changeset
   105
  apply (metis rrexp.simps(12) rrexp.simps(20))
Chengsong
parents: 451
diff changeset
   106
  apply (metis rrexp.inject(3) rrexp.simps(30) rsimp_ALTs.simps(2) rsimp_ALTs.simps(3) shape_of_derseq)
Chengsong
parents: 451
diff changeset
   107
   apply auto[1]
Chengsong
parents: 451
diff changeset
   108
  by auto
Chengsong
parents: 451
diff changeset
   109
Chengsong
parents: 451
diff changeset
   110
lemma alts_preimage_case2:
Chengsong
parents: 451
diff changeset
   111
  shows "rder x r = RALT r1 r2 \<Longrightarrow> \<exists>ra rb. (r = RSEQ ra rb \<or> r = RALT ra rb)"
Chengsong
parents: 451
diff changeset
   112
  apply(case_tac r)
Chengsong
parents: 451
diff changeset
   113
       apply simp+
Chengsong
parents: 451
diff changeset
   114
  apply (metis rrexp.distinct(15) rrexp.distinct(7))
Chengsong
parents: 451
diff changeset
   115
    apply simp
Chengsong
parents: 451
diff changeset
   116
  apply auto[1]
Chengsong
parents: 451
diff changeset
   117
  by auto
Chengsong
parents: 451
diff changeset
   118
Chengsong
parents: 451
diff changeset
   119
lemma alts_preimage_case2_2:
Chengsong
parents: 451
diff changeset
   120
  shows "rder x r = RALT r1 r2 \<Longrightarrow> (\<exists>ra rb. r = RSEQ ra rb) \<or> (\<exists>rc rd. r = RALT rc rd)"
Chengsong
parents: 451
diff changeset
   121
  using alts_preimage_case2 by blast
Chengsong
parents: 451
diff changeset
   122
Chengsong
parents: 451
diff changeset
   123
lemma alts_preimage_case3:
Chengsong
parents: 451
diff changeset
   124
  shows "rder x r = RALT r1 r2 \<Longrightarrow>  (\<exists>ra rb. r = RSEQ ra rb) \<or> (\<exists>rcs rc rd. r = RALTS rcs \<and> rcs = [rc, rd])"
Chengsong
parents: 451
diff changeset
   125
  using alts_preimage_case2 by blast
Chengsong
parents: 451
diff changeset
   126
Chengsong
parents: 451
diff changeset
   127
lemma star_seq:
Chengsong
parents: 451
diff changeset
   128
  shows "rder x (RSEQ (RSTAR a) b) = RALT (RSEQ (RSEQ (rder x a) (RSTAR a)) b) (rder x b)"
Chengsong
parents: 451
diff changeset
   129
  using rder.simps(5) rder.simps(6) rnullable.simps(6) by presburger
Chengsong
parents: 451
diff changeset
   130
Chengsong
parents: 451
diff changeset
   131
lemma language_equality_id1:
Chengsong
parents: 451
diff changeset
   132
  shows "\<not>rnullable a \<Longrightarrow> rder x (RSEQ (RSTAR a) b) = rder x (RALT (RSEQ (RSEQ a (RSTAR a)) b) b)"
Chengsong
parents: 451
diff changeset
   133
  apply (subst star_seq)
Chengsong
parents: 451
diff changeset
   134
  apply simp
Chengsong
parents: 451
diff changeset
   135
  done
Chengsong
parents: 451
diff changeset
   136
Chengsong
parents: 451
diff changeset
   137
  
Chengsong
parents: 451
diff changeset
   138
Chengsong
parents: 451
diff changeset
   139
Chengsong
parents: 451
diff changeset
   140
lemma alts_preimage_cases:
Chengsong
parents: 451
diff changeset
   141
  shows "rder x r = RALT (RSEQ r1 r2) r3 \<Longrightarrow> (\<exists>ra rb. r = RSEQ ra rb) \<or> (\<exists>rc rd re. r = RALT (RSEQ rc rd) re)"
Chengsong
parents: 451
diff changeset
   142
  apply(case_tac r)
Chengsong
parents: 451
diff changeset
   143
       apply simp+
Chengsong
parents: 451
diff changeset
   144
  
Chengsong
parents: 451
diff changeset
   145
  apply (metis rrexp.simps(12) rrexp.simps(20))
Chengsong
parents: 451
diff changeset
   146
    prefer 3
Chengsong
parents: 451
diff changeset
   147
  apply simp
Chengsong
parents: 451
diff changeset
   148
  apply blast
Chengsong
parents: 451
diff changeset
   149
  apply(frule alts_preimage_case2_2)
Chengsong
parents: 451
diff changeset
   150
  apply(case_tac "(\<exists>ra rb. r = RSEQ ra rb)")
Chengsong
parents: 451
diff changeset
   151
   apply blast
Chengsong
parents: 451
diff changeset
   152
  apply(subgoal_tac " (\<exists> rc rd. r = RALT rc rd )")
Chengsong
parents: 451
diff changeset
   153
  prefer 2
Chengsong
parents: 451
diff changeset
   154
   apply blast
Chengsong
parents: 451
diff changeset
   155
  apply(erule exE)+
Chengsong
parents: 451
diff changeset
   156
  apply(subgoal_tac "rder x r = RALT (rder x rc) (rder x rd)")
Chengsong
parents: 451
diff changeset
   157
  prefer 2
Chengsong
parents: 451
diff changeset
   158
  apply force
Chengsong
parents: 451
diff changeset
   159
  apply(subgoal_tac "rder x rc = RSEQ r1 r2")
Chengsong
parents: 451
diff changeset
   160
  oops
Chengsong
parents: 451
diff changeset
   161
Chengsong
parents: 451
diff changeset
   162
Chengsong
parents: 451
diff changeset
   163
lemma der_seq_eq_case:
Chengsong
parents: 451
diff changeset
   164
  shows "\<lbrakk>r1 \<noteq> r2 ; r1 = RSEQ ra rb; rder x r1 = rder x r2\<rbrakk> \<Longrightarrow> rsimp (rder x r1) =  RZERO \<and> rsimp (rder x r2) = RZERO"
Chengsong
parents: 451
diff changeset
   165
  apply(case_tac "rnullable ra")
Chengsong
parents: 451
diff changeset
   166
  apply simp
Chengsong
parents: 451
diff changeset
   167
  oops
Chengsong
parents: 451
diff changeset
   168
Chengsong
parents: 451
diff changeset
   169
  
Chengsong
parents: 451
diff changeset
   170
  
Chengsong
parents: 451
diff changeset
   171
Chengsong
parents: 451
diff changeset
   172
lemma der_map_unequal_to_equal_zero_only:
Chengsong
parents: 451
diff changeset
   173
  shows "\<lbrakk>r1 \<noteq> r2 ; rder x r1 = rder x r2 \<rbrakk> \<Longrightarrow> rsimp (rder x r1) = RZERO"
Chengsong
parents: 451
diff changeset
   174
  apply(induct r1)
Chengsong
parents: 451
diff changeset
   175
       apply simp
Chengsong
parents: 451
diff changeset
   176
      apply simp
Chengsong
parents: 451
diff changeset
   177
     apply simp
Chengsong
parents: 451
diff changeset
   178
     apply(case_tac "x = xa")
Chengsong
parents: 451
diff changeset
   179
      apply simp
Chengsong
parents: 451
diff changeset
   180
      apply(subgoal_tac "r2 = RCHAR xa")
Chengsong
parents: 451
diff changeset
   181
  prefer 2
Chengsong
parents: 451
diff changeset
   182
  using inv_one_derx apply blast
Chengsong
parents: 451
diff changeset
   183
      apply simp
Chengsong
parents: 451
diff changeset
   184
  using rsimp.simps(3) apply presburger
Chengsong
parents: 451
diff changeset
   185
    apply(case_tac "rder x (RSEQ r11 r12)")
Chengsong
parents: 451
diff changeset
   186
         apply simp
Chengsong
parents: 451
diff changeset
   187
        apply (metis inv_one_derx)
Chengsong
parents: 451
diff changeset
   188
       apply (metis rrexp.distinct(21) rrexp.simps(24) shape_of_derseq)
Chengsong
parents: 451
diff changeset
   189
      apply(subgoal_tac "rder x r2 = RSEQ x41 x42")
Chengsong
parents: 451
diff changeset
   190
  prefer 2
Chengsong
parents: 451
diff changeset
   191
       apply presburger
Chengsong
parents: 451
diff changeset
   192
      apply(subgoal_tac "x41 = rder x r11")
Chengsong
parents: 451
diff changeset
   193
       prefer 2
Chengsong
parents: 451
diff changeset
   194
       apply (meson shape_of_derseq2)
Chengsong
parents: 451
diff changeset
   195
      apply(case_tac r2)
Chengsong
parents: 451
diff changeset
   196
           apply simp+
Chengsong
parents: 451
diff changeset
   197
  apply (metis rrexp.distinct(13) rrexp.simps(10))
Chengsong
parents: 451
diff changeset
   198
        apply(subgoal_tac "x42a = x42")
Chengsong
parents: 451
diff changeset
   199
  prefer 2
Chengsong
parents: 451
diff changeset
   200
  apply (metis rrexp.inject(2) rrexp.simps(30) shape_of_derseq)
Chengsong
parents: 451
diff changeset
   201
  apply(subgoal_tac "rder x x41a =  x41")
Chengsong
parents: 451
diff changeset
   202
        prefer 2 
Chengsong
parents: 451
diff changeset
   203
  apply (metis shape_of_derseq2)
Chengsong
parents: 451
diff changeset
   204
        apply(simp)
Chengsong
parents: 451
diff changeset
   205
        apply(subgoal_tac "\<not> rnullable r11")
Chengsong
parents: 451
diff changeset
   206
  prefer 2
Chengsong
parents: 451
diff changeset
   207
  apply force
Chengsong
parents: 451
diff changeset
   208
        apply simp
Chengsong
parents: 451
diff changeset
   209
        apply(subgoal_tac "\<not> rnullable x41a")
Chengsong
parents: 451
diff changeset
   210
  prefer 2
Chengsong
parents: 451
diff changeset
   211
         apply force
Chengsong
parents: 451
diff changeset
   212
        apply simp
Chengsong
parents: 451
diff changeset
   213
  
Chengsong
parents: 451
diff changeset
   214
  oops
Chengsong
parents: 451
diff changeset
   215
Chengsong
parents: 451
diff changeset
   216
Chengsong
parents: 451
diff changeset
   217
Chengsong
parents: 451
diff changeset
   218
lemma der_maps_1to1_except0:
Chengsong
parents: 451
diff changeset
   219
  shows "\<lbrakk>rder x ` rset = dset; a \<notin> rset; rder x a \<in> dset\<rbrakk> \<Longrightarrow> rsimp (rder x a) = RZERO"
Chengsong
parents: 451
diff changeset
   220
  
Chengsong
parents: 451
diff changeset
   221
Chengsong
parents: 451
diff changeset
   222
  sorry
Chengsong
parents: 451
diff changeset
   223
Chengsong
parents: 451
diff changeset
   224
lemma distinct_der_set:
Chengsong
parents: 451
diff changeset
   225
  shows "(rder x) ` rset = dset \<Longrightarrow>
Chengsong
parents: 451
diff changeset
   226
rsimp (rsimp_ALTs (map (rder x) (rdistinct rs rset))) = rsimp ( rsimp_ALTs (rdistinct (map (rder x) rs) dset))"
Chengsong
parents: 451
diff changeset
   227
  apply(induct rs arbitrary: rset dset)
Chengsong
parents: 451
diff changeset
   228
   apply simp
Chengsong
parents: 451
diff changeset
   229
  apply(case_tac "a \<in> rset")
Chengsong
parents: 451
diff changeset
   230
   apply(subgoal_tac "rder x a \<in> dset")
Chengsong
parents: 451
diff changeset
   231
  prefer 2
Chengsong
parents: 451
diff changeset
   232
    apply blast
Chengsong
parents: 451
diff changeset
   233
   apply simp
Chengsong
parents: 451
diff changeset
   234
  apply(case_tac "rder x a \<notin> dset")
Chengsong
parents: 451
diff changeset
   235
   prefer 2
Chengsong
parents: 451
diff changeset
   236
   apply simp
Chengsong
parents: 451
diff changeset
   237
 
Chengsong
parents: 451
diff changeset
   238
  oops
Chengsong
parents: 451
diff changeset
   239
Chengsong
parents: 451
diff changeset
   240
lemma map_concat_cons:
Chengsong
parents: 451
diff changeset
   241
  shows "map f rsa @ f a # rs = map f (rsa @ [a]) @ rs"
Chengsong
parents: 451
diff changeset
   242
  by simp
Chengsong
parents: 451
diff changeset
   243
Chengsong
parents: 451
diff changeset
   244
lemma neg_removal_element_of:
Chengsong
parents: 451
diff changeset
   245
  shows " \<not> a \<notin> aset \<Longrightarrow> a \<in> aset"
Chengsong
parents: 451
diff changeset
   246
  by simp
Chengsong
parents: 451
diff changeset
   247
Chengsong
parents: 451
diff changeset
   248
lemma simp_more_flts:
Chengsong
parents: 451
diff changeset
   249
  shows "rsimp (rsimp_ALTs (rdistinct rs {})) = rsimp (rsimp_ALTs (rdistinct (rflts rs) {}))"
Chengsong
parents: 451
diff changeset
   250
Chengsong
parents: 451
diff changeset
   251
  oops
Chengsong
parents: 451
diff changeset
   252
Chengsong
parents: 451
diff changeset
   253
Chengsong
parents: 451
diff changeset
   254
Chengsong
parents: 451
diff changeset
   255
lemma simp_more_distinct:
Chengsong
parents: 451
diff changeset
   256
  shows "rsimp  (rsimp_ALTs (rsa @ rs)) = rsimp (rsimp_ALTs (rsa @ (rdistinct rs (set rsa)))) \<and>
Chengsong
parents: 451
diff changeset
   257
  rsimp (rsimp_ALTs (rsb @ (rdistinct rs (set rsb)))) = 
Chengsong
parents: 451
diff changeset
   258
  rsimp (rsimp_ALTs (rsb @ (rdistinct (rflts rs) (set rsb))))"
Chengsong
parents: 451
diff changeset
   259
  apply(induct rs arbitrary: rsa rsb)
Chengsong
parents: 451
diff changeset
   260
   apply simp
Chengsong
parents: 451
diff changeset
   261
Chengsong
parents: 451
diff changeset
   262
  sorry
Chengsong
parents: 451
diff changeset
   263
Chengsong
parents: 451
diff changeset
   264
lemma non_empty_list:
Chengsong
parents: 451
diff changeset
   265
  shows "a \<in> set as \<Longrightarrow> as \<noteq> []"
Chengsong
parents: 451
diff changeset
   266
  
Chengsong
parents: 451
diff changeset
   267
  by (metis empty_iff empty_set)
Chengsong
parents: 451
diff changeset
   268
Chengsong
parents: 451
diff changeset
   269
Chengsong
parents: 451
diff changeset
   270
lemma distinct_removes_last:
Chengsong
parents: 451
diff changeset
   271
  shows "\<lbrakk>a \<in> set as; rsimp a \<in> set (map rsimp as)\<rbrakk>
Chengsong
parents: 451
diff changeset
   272
    \<Longrightarrow> rsimp_ALTs (rdistinct (rflts (map rsimp as @ [rsimp a])) {}) =
Chengsong
parents: 451
diff changeset
   273
        rsimp_ALTs (rdistinct (rflts (map rsimp as)) {})"
Chengsong
parents: 451
diff changeset
   274
  apply(induct "rsimp a" arbitrary: as)
Chengsong
parents: 451
diff changeset
   275
       apply(simp)
Chengsong
parents: 451
diff changeset
   276
       apply (metis append.right_neutral append_self_conv2 empty_set list.simps(9) map_append rflts.simps(2) rsimp.simps(2) rsimp_idem simp_more_distinct spawn_simp_rsimpalts)
Chengsong
parents: 451
diff changeset
   277
  apply simp
Chengsong
parents: 451
diff changeset
   278
  sorry
Chengsong
parents: 451
diff changeset
   279
Chengsong
parents: 451
diff changeset
   280
lemma flts_identity1:
Chengsong
parents: 451
diff changeset
   281
  shows  "rflts (rs @ [RONE]) = rflts rs @ [RONE] "
Chengsong
parents: 451
diff changeset
   282
  apply(induct rs)
Chengsong
parents: 451
diff changeset
   283
   apply simp+
Chengsong
parents: 451
diff changeset
   284
  apply(case_tac a)
Chengsong
parents: 451
diff changeset
   285
       apply simp
Chengsong
parents: 451
diff changeset
   286
      apply simp+
Chengsong
parents: 451
diff changeset
   287
  done
Chengsong
parents: 451
diff changeset
   288
Chengsong
parents: 451
diff changeset
   289
lemma flts_identity10:
Chengsong
parents: 451
diff changeset
   290
  shows " rflts (rs @ [RCHAR c]) = rflts rs @ [RCHAR c]"
Chengsong
parents: 451
diff changeset
   291
  apply(induct rs)
Chengsong
parents: 451
diff changeset
   292
   apply simp+
Chengsong
parents: 451
diff changeset
   293
  apply(case_tac a)
Chengsong
parents: 451
diff changeset
   294
       apply simp+
Chengsong
parents: 451
diff changeset
   295
  done
Chengsong
parents: 451
diff changeset
   296
Chengsong
parents: 451
diff changeset
   297
lemma flts_identity11:
Chengsong
parents: 451
diff changeset
   298
  shows " rflts (rs @ [RSEQ r1 r2]) = rflts rs @ [RSEQ r1 r2]"
Chengsong
parents: 451
diff changeset
   299
  apply(induct rs)
Chengsong
parents: 451
diff changeset
   300
   apply simp+
Chengsong
parents: 451
diff changeset
   301
  apply(case_tac a)
Chengsong
parents: 451
diff changeset
   302
       apply simp+
Chengsong
parents: 451
diff changeset
   303
  done
Chengsong
parents: 451
diff changeset
   304
Chengsong
parents: 451
diff changeset
   305
lemma flts_identity12:
Chengsong
parents: 451
diff changeset
   306
  shows " rflts (rs @ [RSTAR r0]) = rflts rs @ [RSTAR r0]"
Chengsong
parents: 451
diff changeset
   307
  apply(induct rs)
Chengsong
parents: 451
diff changeset
   308
   apply simp+
Chengsong
parents: 451
diff changeset
   309
  apply(case_tac a)
Chengsong
parents: 451
diff changeset
   310
       apply simp+
Chengsong
parents: 451
diff changeset
   311
  done
Chengsong
parents: 451
diff changeset
   312
Chengsong
parents: 451
diff changeset
   313
lemma flts_identity2:
Chengsong
parents: 451
diff changeset
   314
  shows "a \<noteq> RZERO \<and> (\<forall>rs. a \<noteq> RALTS rs) \<Longrightarrow>  rflts (rs @ [a]) = rflts rs @ [a]"
Chengsong
parents: 451
diff changeset
   315
  apply(case_tac a)
Chengsong
parents: 451
diff changeset
   316
       apply simp
Chengsong
parents: 451
diff changeset
   317
  using flts_identity1 apply auto[1]
Chengsong
parents: 451
diff changeset
   318
  using flts_identity10 apply blast
Chengsong
parents: 451
diff changeset
   319
  using flts_identity11 apply auto[1]
Chengsong
parents: 451
diff changeset
   320
   apply blast
Chengsong
parents: 451
diff changeset
   321
  using flts_identity12 by presburger
Chengsong
parents: 451
diff changeset
   322
  
Chengsong
parents: 451
diff changeset
   323
Chengsong
parents: 451
diff changeset
   324
lemma last_elem_dup1:
Chengsong
parents: 451
diff changeset
   325
  shows " a \<in> set as \<Longrightarrow> rsimp (RALTS (as @ [a] )) = rsimp (RALTS (as ))"
Chengsong
parents: 451
diff changeset
   326
  apply simp
Chengsong
parents: 451
diff changeset
   327
  apply(subgoal_tac "rsimp a \<in> set (map rsimp as)")
Chengsong
parents: 451
diff changeset
   328
  prefer 2
Chengsong
parents: 451
diff changeset
   329
   apply simp
Chengsong
parents: 451
diff changeset
   330
Chengsong
parents: 451
diff changeset
   331
  sorry
Chengsong
parents: 451
diff changeset
   332
Chengsong
parents: 451
diff changeset
   333
lemma last_elem_dup:
Chengsong
parents: 451
diff changeset
   334
  shows " a \<in> set as \<Longrightarrow> rsimp (rsimp_ALTs (as @ [a] )) = rsimp (rsimp_ALTs (as ))"
Chengsong
parents: 451
diff changeset
   335
  apply(induct as rule: rev_induct)
Chengsong
parents: 451
diff changeset
   336
   apply simp
Chengsong
parents: 451
diff changeset
   337
  apply simp
Chengsong
parents: 451
diff changeset
   338
  apply(subgoal_tac "xs \<noteq> []")
Chengsong
parents: 451
diff changeset
   339
  prefer 2
Chengsong
parents: 451
diff changeset
   340
  
Chengsong
parents: 451
diff changeset
   341
Chengsong
parents: 451
diff changeset
   342
  
Chengsong
parents: 451
diff changeset
   343
Chengsong
parents: 451
diff changeset
   344
  sorry
Chengsong
parents: 451
diff changeset
   345
Chengsong
parents: 451
diff changeset
   346
lemma appeared_before_remove_later:
Chengsong
parents: 451
diff changeset
   347
  shows "a \<in>  set as \<Longrightarrow> rsimp (rsimp_ALTs ( as @ a # rs)) = rsimp (rsimp_ALTs (as @ rs))"
Chengsong
parents: 451
diff changeset
   348
and "a \<in> set as \<Longrightarrow> rsimp (rsimp_ALTs as ) = rsimp (rsimp_ALTs (as @ [a]))"
Chengsong
parents: 451
diff changeset
   349
  apply(induct rs arbitrary: as)
Chengsong
parents: 451
diff changeset
   350
   apply simp
Chengsong
parents: 451
diff changeset
   351
  
Chengsong
parents: 451
diff changeset
   352
Chengsong
parents: 451
diff changeset
   353
  sorry
Chengsong
parents: 451
diff changeset
   354
Chengsong
parents: 451
diff changeset
   355
lemma distinct_remove_later:
Chengsong
parents: 451
diff changeset
   356
  shows "\<lbrakk>rder x a \<in> rder x ` set rsa\<rbrakk>
Chengsong
parents: 451
diff changeset
   357
       \<Longrightarrow> rsimp (rsimp_ALTs (map (rder x) rsa @ rder x a # map (rder x) (rdistinct rs (insert a (set rsa))))) =
Chengsong
parents: 451
diff changeset
   358
           rsimp (rsimp_ALTs (map (rder x) rsa @ map (rder x) (rdistinct rs (set rsa))))"
451
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   359
  
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   360
  sorry
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   361
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   362
453
Chengsong
parents: 451
diff changeset
   363
lemma distinct_der_general:
Chengsong
parents: 451
diff changeset
   364
  shows "rsimp (rsimp_ALTs (map (rder x) (rsa @ (rdistinct rs (set rsa))))) =
Chengsong
parents: 451
diff changeset
   365
 rsimp ( rsimp_ALTs ((map (rder x) rsa)@(rdistinct (map (rder x) rs) (set (map (rder x) rsa)))) )"
Chengsong
parents: 451
diff changeset
   366
  apply(induct rs arbitrary: rsa)
Chengsong
parents: 451
diff changeset
   367
   apply simp
Chengsong
parents: 451
diff changeset
   368
  apply(case_tac "a \<in> set rsa")
Chengsong
parents: 451
diff changeset
   369
   apply(subgoal_tac "rder x a \<in> set (map (rder x) rsa)")
Chengsong
parents: 451
diff changeset
   370
  apply simp
Chengsong
parents: 451
diff changeset
   371
   apply simp
Chengsong
parents: 451
diff changeset
   372
  apply(case_tac "rder x a \<notin> set (map (rder x) rsa)")
Chengsong
parents: 451
diff changeset
   373
   apply(simp)
Chengsong
parents: 451
diff changeset
   374
  apply(subst map_concat_cons)+
Chengsong
parents: 451
diff changeset
   375
  apply(drule_tac x = "rsa @ [a]" in meta_spec)
Chengsong
parents: 451
diff changeset
   376
   apply simp
Chengsong
parents: 451
diff changeset
   377
  apply(drule neg_removal_element_of)
Chengsong
parents: 451
diff changeset
   378
  apply simp
Chengsong
parents: 451
diff changeset
   379
  apply(subst distinct_remove_later)
Chengsong
parents: 451
diff changeset
   380
   apply simp
Chengsong
parents: 451
diff changeset
   381
  apply(drule_tac x = "rsa" in meta_spec)
Chengsong
parents: 451
diff changeset
   382
  by blast
Chengsong
parents: 451
diff changeset
   383
Chengsong
parents: 451
diff changeset
   384
  
Chengsong
parents: 451
diff changeset
   385
Chengsong
parents: 451
diff changeset
   386
451
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   387
lemma distinct_der:
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   388
  shows "rsimp (rsimp_ALTs (map (rder x) (rdistinct rs {}))) = rsimp ( rsimp_ALTs (rdistinct (map (rder x) rs) {}))"
453
Chengsong
parents: 451
diff changeset
   389
  by (metis distinct_der_general list.simps(8) self_append_conv2 set_empty)
451
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   390
453
Chengsong
parents: 451
diff changeset
   391
  
Chengsong
parents: 451
diff changeset
   392
Chengsong
parents: 451
diff changeset
   393
Chengsong
parents: 451
diff changeset
   394
lemma rders_simp_lambda:
Chengsong
parents: 451
diff changeset
   395
  shows " rsimp \<circ> rder x \<circ> (\<lambda>r. rders_simp r xs) = (\<lambda>r. rders_simp r (xs @ [x]))"
Chengsong
parents: 451
diff changeset
   396
  using rders_simp_append by auto
451
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   397
453
Chengsong
parents: 451
diff changeset
   398
lemma rders_simp_nonempty_simped:
Chengsong
parents: 451
diff changeset
   399
  shows "xs \<noteq> [] \<Longrightarrow> rsimp \<circ> (\<lambda>r. rders_simp r xs) = (\<lambda>r. rders_simp r xs)"
Chengsong
parents: 451
diff changeset
   400
  using rders_simp_same_simpders rsimp_idem by auto
Chengsong
parents: 451
diff changeset
   401
Chengsong
parents: 451
diff changeset
   402
lemma repeated_altssimp:
Chengsong
parents: 451
diff changeset
   403
  shows "\<forall>r \<in> set rs. rsimp r = r \<Longrightarrow> rsimp (rsimp_ALTs (rdistinct (rflts rs) {})) =
Chengsong
parents: 451
diff changeset
   404
           rsimp_ALTs (rdistinct (rflts rs) {})"
Chengsong
parents: 451
diff changeset
   405
  by (metis map_idI rsimp.simps(2) rsimp_idem)
451
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   406
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   407
lemma alts_closed_form: shows 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   408
"rsimp (rders_simp (RALTS rs) s) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   409
rsimp (RALTS (map (\<lambda>r. rders_simp r s) rs))"
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   410
  apply(induct s rule: rev_induct)
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   411
   apply simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   412
  apply simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   413
  apply(subst rders_simp_append)
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   414
  apply(subgoal_tac " rsimp (rders_simp (rders_simp (RALTS rs) xs) [x]) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   415
 rsimp(rders_simp (rsimp_ALTs (rdistinct (rflts (map (rsimp \<circ> (\<lambda>r. rders_simp r xs)) rs)) {})) [x])")
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   416
   prefer 2
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   417
  apply (metis inside_simp_removal rders_simp_one_char)
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   418
  apply(simp only: )
451
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   419
  apply(subst rders_simp_one_char)
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   420
  apply(subst rsimp_idem)
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   421
  apply(subgoal_tac "rsimp (rder x (rsimp_ALTs (rdistinct (rflts (map (rsimp \<circ> (\<lambda>r. rders_simp r xs)) rs)) {}))) =
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   422
                     rsimp ((rsimp_ALTs (map (rder x) (rdistinct (rflts (map (rsimp \<circ> (\<lambda>r. rders_simp r xs)) rs)) {})))) ")
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   423
  prefer 2
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   424
  using rder_rsimp_ALTs_commute apply presburger
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   425
  apply(simp only:)
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   426
  apply(subgoal_tac "rsimp (rsimp_ALTs (map (rder x) (rdistinct (rflts (map (rsimp \<circ> (\<lambda>r. rders_simp r xs)) rs)) {})))
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   427
= rsimp (rsimp_ALTs (rdistinct (map (rder x) (rflts (map (rsimp \<circ> (\<lambda>r. rders_simp r xs)) rs))) {}))")
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   428
   prefer 2
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   429
  
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   430
  using distinct_der apply presburger
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   431
  apply(simp only:)
453
Chengsong
parents: 451
diff changeset
   432
  apply(subgoal_tac " rsimp (rsimp_ALTs (rdistinct (map (rder x) (rflts (map (rsimp \<circ> (\<lambda>r. rders_simp r xs)) rs))) {})) =
Chengsong
parents: 451
diff changeset
   433
                      rsimp (rsimp_ALTs (rdistinct ( (rflts (map (rder x) (map (rsimp \<circ> (\<lambda>r. rders_simp r xs)) rs)))) {}))")
Chengsong
parents: 451
diff changeset
   434
   apply(simp only:)
Chengsong
parents: 451
diff changeset
   435
  apply(subgoal_tac " rsimp (rsimp_ALTs (rdistinct (rflts (map (rder x) (map (rsimp \<circ> (\<lambda>r. rders_simp r xs)) rs))) {})) = 
Chengsong
parents: 451
diff changeset
   436
                      rsimp (rsimp_ALTs (rdistinct (rflts ( (map (rsimp \<circ> (rder x) \<circ> (\<lambda>r. rders_simp r xs)) rs))) {}))")
Chengsong
parents: 451
diff changeset
   437
    apply(simp only:)
Chengsong
parents: 451
diff changeset
   438
  apply(subst rders_simp_lambda)
Chengsong
parents: 451
diff changeset
   439
    apply(subst rders_simp_nonempty_simped)
Chengsong
parents: 451
diff changeset
   440
     apply simp
Chengsong
parents: 451
diff changeset
   441
    apply(subgoal_tac "\<forall>r \<in> set  (map (\<lambda>r. rders_simp r (xs @ [x])) rs). rsimp r = r")
Chengsong
parents: 451
diff changeset
   442
  prefer 2
Chengsong
parents: 451
diff changeset
   443
     apply (simp add: rders_simp_same_simpders rsimp_idem)
Chengsong
parents: 451
diff changeset
   444
    apply(subst repeated_altssimp)
Chengsong
parents: 451
diff changeset
   445
     apply simp
Chengsong
parents: 451
diff changeset
   446
  apply fastforce
Chengsong
parents: 451
diff changeset
   447
  apply (metis inside_simp_removal list.map_comp rder.simps(4) rsimp.simps(2) rsimp_idem)
Chengsong
parents: 451
diff changeset
   448
  
Chengsong
parents: 451
diff changeset
   449
(*  apply (metis head_one_more_simp list.inject list.map_comp list.simps(9) rders_simp_lambda rsimp.simps(2))
Chengsong
parents: 451
diff changeset
   450
*)
451
7a016eeb118d finiteness
Chengsong
parents: 445
diff changeset
   451
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   452
  sorry
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   453
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   454
lemma alts_closed_form_variant: shows 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   455
"s \<noteq> [] \<Longrightarrow> rders_simp (RALTS rs) s = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   456
rsimp (RALTS (map (\<lambda>r. rders_simp r s) rs))"
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   457
  sorry
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   458
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   459
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   460
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   461
lemma star_closed_form:
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   462
  shows "rders_simp (RSTAR r0) (c#s) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   463
rsimp ( RALTS ( (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0) ) (star_updates s r0 [[c]]) ) ))"
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   464
  apply(induct s)
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   465
   apply simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   466
  sorry
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   467
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   468
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   469
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   470
lemma seq_closed_form: shows 
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   471
"rsimp (rders_simp (RSEQ r1 r2) s) = 
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   472
rsimp ( RALTS ( (RSEQ (rders_simp r1 s) r2) # 
445
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   473
                (map (rders_simp r2) (vsuf s r1)) 
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   474
              )  
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   475
      )"
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   476
  apply(induct s)
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   477
  apply simp
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   478
  sorry
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   479
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   480
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   481
lemma seq_closed_form_variant: shows
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   482
"s \<noteq> [] \<Longrightarrow> (rders_simp (RSEQ r1 r2) s) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   483
rsimp (RALTS ((RSEQ (rders_simp r1 s) r2) # (map (rders_simp r2) (vsuf s r1))))"
445
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   484
  apply(induct s rule: rev_induct)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   485
   apply simp
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   486
  apply(subst rders_simp_append)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   487
  apply(subst rders_simp_one_char)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   488
  apply(subst rsimp_idem[symmetric])
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   489
  apply(subst rders_simp_one_char[symmetric])
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   490
  apply(subst rders_simp_append[symmetric])
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   491
  apply(insert seq_closed_form)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   492
  apply(subgoal_tac "rsimp (rders_simp (RSEQ r1 r2) (xs @ [x]))
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   493
 = rsimp (RALTS (RSEQ (rders_simp r1 (xs @ [x])) r2 # map (rders_simp r2) (vsuf (xs @ [x]) r1)))")
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   494
   apply force
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   495
  by presburger
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
   496
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
   497
end