thys2/ClosedForms.thy
author Chengsong
Thu, 10 Mar 2022 11:18:41 +0000
changeset 445 e072cfc2f2ee
parent 444 a7e98deebb5c
child 451 7a016eeb118d
permissions -rw-r--r--
closedforms
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
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
     5
lemma alts_closed_form: shows 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
     6
"rsimp (rders_simp (RALTS rs) s) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
     7
rsimp (RALTS (map (\<lambda>r. rders_simp r s) rs))"
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
     8
  apply(induct s rule: rev_induct)
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
     9
   apply simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    10
  apply simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    11
  apply(subst rders_simp_append)
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    12
  apply(subgoal_tac " rsimp (rders_simp (rders_simp (RALTS rs) xs) [x]) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    13
 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
    14
   prefer 2
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    15
  apply (metis inside_simp_removal rders_simp_one_char)
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    16
  apply(simp only: )
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    17
  sorry
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    18
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    19
lemma alts_closed_form_variant: shows 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    20
"s \<noteq> [] \<Longrightarrow> rders_simp (RALTS rs) s = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    21
rsimp (RALTS (map (\<lambda>r. rders_simp r s) rs))"
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    22
  sorry
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    23
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    24
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    25
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    26
lemma star_closed_form:
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    27
  shows "rders_simp (RSTAR r0) (c#s) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    28
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
    29
  apply(induct s)
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    30
   apply simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    31
  sorry
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    32
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    33
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    34
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    35
lemma seq_closed_form: shows 
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    36
"rsimp (rders_simp (RSEQ r1 r2) s) = 
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    37
rsimp ( RALTS ( (RSEQ (rders_simp r1 s) r2) # 
445
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    38
                (map (rders_simp r2) (vsuf s r1)) 
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    39
              )  
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    40
      )"
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    41
  apply(induct s)
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    42
  apply simp
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    43
  sorry
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    44
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    45
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    46
lemma seq_closed_form_variant: shows
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    47
"s \<noteq> [] \<Longrightarrow> (rders_simp (RSEQ r1 r2) s) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    48
rsimp (RALTS ((RSEQ (rders_simp r1 s) r2) # (map (rders_simp r2) (vsuf s r1))))"
445
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    49
  apply(induct s rule: rev_induct)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    50
   apply simp
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    51
  apply(subst rders_simp_append)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    52
  apply(subst rders_simp_one_char)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    53
  apply(subst rsimp_idem[symmetric])
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    54
  apply(subst rders_simp_one_char[symmetric])
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    55
  apply(subst rders_simp_append[symmetric])
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    56
  apply(insert seq_closed_form)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    57
  apply(subgoal_tac "rsimp (rders_simp (RSEQ r1 r2) (xs @ [x]))
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    58
 = rsimp (RALTS (RSEQ (rders_simp r1 (xs @ [x])) r2 # map (rders_simp r2) (vsuf (xs @ [x]) r1)))")
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    59
   apply force
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    60
  by presburger
443
c6351a96bf80 writeupforclosedforms
Chengsong
parents:
diff changeset
    61
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents: 443
diff changeset
    62
end