Step * 2 1 1 of Lemma loop-class-state-program_wf


1. Info Type
2. Type
3. valueall-type(B)
4. EClass(B ⟶ B)
5. init Id ⟶ bag(B)
6. pr Id ⟶ hdataflow(Info;B ⟶ B)
7. ∀es:EO+(Info). ∀e:E.  (X(e) (snd(pr loc(e)*(map(λx.info(x);before(e)))(info(e)))) ∈ bag(B ⟶ B))
8. es EO+(Info)@i'
9. E@i
10. hdf-state(pr loc(e);init loc(e))*(map(λx.info(x);before(e)))
hdf-state(pr loc(e)*(map(λx.info(x);before(e)));Prior(loop-class-state(X;init))?init(e))
∈ hdataflow(Info;B)
11. bag(B)@i
12. Prior(loop-class-state(X;init))?init(e) v ∈ bag(B)@i
13. Info ⟶ (hdataflow(Info;B ⟶ B) × bag(B ⟶ B))@i
⊢ if ¬b(#(snd((x info(e)))) =z 0) then ⋃f∈snd((x info(e))).bag-map(f;v) else fi 
(snd(let s1,b let X',fs info(e) 
                  in let b ⟵ ⋃f∈fs.bag-map(f;v)
                     in let s' ⟵ if bag-null(b) then else fi 
                        in <<X', s'>s'> 
       in <mk-hdf(Xbs,a.let X,s Xbs 
                        in let X',fs case of inl(P) => inr(z) => <inr ⋅ {}> 
                           in let b ⟵ ⋃f∈fs.bag-map(f;s)
                              in let s' ⟵ if bag-null(b) then else fi 
                                 in <<X', s'>s'>;s.ff;s1)
          b
          >))
∈ bag(B)
BY
((GenApply (-1) THENA Auto)
   THEN (-2)
   THEN Reduce 0
   THEN (CallByValueReduceOn ⌜⋃f∈z2.bag-map(f;v)⌝ 0⋅ THENA MaAuto)
   THEN (CallByValueReduceOn ⌜if bag-null(⋃f∈z2.bag-map(f;v)) then else ⋃f∈z2.bag-map(f;v) fi ⌝ 0⋅ THENA MaAuto)
   THEN Reduce 0
   THEN RepeatFor (OldAutoSplit)
   THEN Try (Complete (((InstLemma `bag-size-zero` [⌜B ⟶ B⌝;⌜z2⌝]⋅ THENA Auto)
                        THEN (RWO "-1" (-2) THENA Auto)
                        THEN Reduce (-2)
                        THEN (-2)
                        THEN Auto)))
   THEN (RWO "assert-bag-null<(-1) THENA Auto)
   THEN (RWO "bag-combine-null" (-1) THENA Auto)
   THEN (Assert ⌜0 < #(z2)⌝⋅ THENA Auto')
   THEN (RWO "bag-size-bag-member" (-1) THENA Auto)
   THEN SquashExRepD
   THEN (FHyp (-3) [-1] THENA Auto)
   THEN RepUR ``bag-null`` (-1)
   THEN (RWO "bag-map-null" (-1) THENA Auto)
   THEN Fold `bag-null` (-1)
   THEN (RWO "assert-bag-null" (-1) THENA Auto)
   THEN (RWO "-1" THENA Auto)
   THEN (Reduce THENA Auto)
   THEN RWO "bag-combine-empty-right" 0
   THEN Auto) }


Latex:


Latex:

1.  Info  :  Type
2.  B  :  Type
3.  valueall-type(B)
4.  X  :  EClass(B  {}\mrightarrow{}  B)
5.  init  :  Id  {}\mrightarrow{}  bag(B)
6.  pr  :  Id  {}\mrightarrow{}  hdataflow(Info;B  {}\mrightarrow{}  B)
7.  \mforall{}es:EO+(Info).  \mforall{}e:E.    (X(e)  =  (snd(pr  loc(e)*(map(\mlambda{}x.info(x);before(e)))(info(e)))))
8.  es  :  EO+(Info)@i'
9.  e  :  E@i
10.  hdf-state(pr  loc(e);init  loc(e))*(map(\mlambda{}x.info(x);before(e)))
=  hdf-state(pr  loc(e)*(map(\mlambda{}x.info(x);before(e)));Prior(loop-class-state(X;init))?init(e))
11.  v  :  bag(B)@i
12.  Prior(loop-class-state(X;init))?init(e)  =  v@i
13.  x  :  Info  {}\mrightarrow{}  (hdataflow(Info;B  {}\mrightarrow{}  B)  \mtimes{}  bag(B  {}\mrightarrow{}  B))@i
\mvdash{}  if  \mneg{}\msubb{}(\#(snd((x  info(e))))  =\msubz{}  0)  then  \mcup{}f\mmember{}snd((x  info(e))).bag-map(f;v)  else  v  fi 
=  (snd(let  s1,b  =  let  X',fs  =  x  info(e) 
                                    in  let  b  \mleftarrow{}{}  \mcup{}f\mmember{}fs.bag-map(f;v)
                                          in  let  s'  \mleftarrow{}{}  if  bag-null(b)  then  v  else  b  fi 
                                                in  <<X',  s'>,  s'> 
              in  <mk-hdf(Xbs,a.let  X,s  =  Xbs 
                                                in  let  X',fs  =  case  X  of  inl(P)  =>  P  a  |  inr(z)  =>  <inr  \mcdot{}  ,  \{\}> 
                                                      in  let  b  \mleftarrow{}{}  \mcup{}f\mmember{}fs.bag-map(f;s)
                                                            in  let  s'  \mleftarrow{}{}  if  bag-null(b)  then  s  else  b  fi 
                                                                  in  <<X',  s'>,  s'>s.ff;s1)
                    ,  b
                    >))


By


Latex:
((GenApply  (-1)  THENA  Auto)
  THEN  D  (-2)
  THEN  Reduce  0
  THEN  (CallByValueReduceOn  \mkleeneopen{}\mcup{}f\mmember{}z2.bag-map(f;v)\mkleeneclose{}  0\mcdot{}  THENA  MaAuto)
  THEN  (CallByValueReduceOn  \mkleeneopen{}if  bag-null(\mcup{}f\mmember{}z2.bag-map(f;v))  then  v  else  \mcup{}f\mmember{}z2.bag-map(f;v)  fi  \mkleeneclose{}  0\mcdot{}
              THENA  MaAuto
              )
  THEN  Reduce  0
  THEN  RepeatFor  2  (OldAutoSplit)
  THEN  Try  (Complete  (((InstLemma  `bag-size-zero`  [\mkleeneopen{}B  {}\mrightarrow{}  B\mkleeneclose{};\mkleeneopen{}z2\mkleeneclose{}]\mcdot{}  THENA  Auto)
                                            THEN  (RWO  "-1"  (-2)  THENA  Auto)
                                            THEN  Reduce  (-2)
                                            THEN  D  (-2)
                                            THEN  Auto)))
  THEN  (RWO  "assert-bag-null<"  (-1)  THENA  Auto)
  THEN  (RWO  "bag-combine-null"  (-1)  THENA  Auto)
  THEN  (Assert  \mkleeneopen{}0  <  \#(z2)\mkleeneclose{}\mcdot{}  THENA  Auto')
  THEN  (RWO  "bag-size-bag-member"  (-1)  THENA  Auto)
  THEN  SquashExRepD
  THEN  (FHyp  (-3)  [-1]  THENA  Auto)
  THEN  RepUR  ``bag-null``  (-1)
  THEN  (RWO  "bag-map-null"  (-1)  THENA  Auto)
  THEN  Fold  `bag-null`  (-1)
  THEN  (RWO  "assert-bag-null"  (-1)  THENA  Auto)
  THEN  (RWO  "-1"  0  THENA  Auto)
  THEN  (Reduce  0  THENA  Auto)
  THEN  RWO  "bag-combine-empty-right"  0
  THEN  Auto)




Home Index