Step * of Lemma hdf-parallel-transformation2-3

[L,G,H,S,init,out:Top]. ∀[m:ℕ].
  (inl a.<inr Ax out>|| fix((λmk-hdf,s. (inl a.cbva_seq(L[s;a]; λg.<case H[g;s]
                                                                             of inl() =>
                                                                             mk-hdf S[g;s]
                                                                             inr() =>
                                                                             inr Ax 
                                                                           G[g]
                                                                           >m))))) 
                              init fix((λmk-hdf,s. (inl a.cbva_seq(λn.if (n =z m)
                                                                          then case fst(s)
                                                                                of inl(x) =>
                                                                                mk_lambdas_fun(λg.(out G[g]);m)
                                                                                inr(x) =>
                                                                                mk_lambdas_fun(λg.G[g];m)
                                                                          else L[snd(s);a] n
                                                                          fi ; λg.<case H[partial_ap(g;m 1;m);snd(s)]
                                                                                    of inl() =>
                                                                                    mk-hdf 
                                                                                    <inr Ax 
                                                                                    S[partial_ap(g;m 1;m);snd(s)]
                                                                                    >
                                                                                    inr() =>
                                                                                    inr Ax 
                                                                                  select_fun_last(g;m)
                                                                                  >1))))) 
                                     <inl Ax, init>)
BY
(Auto
   THEN ProcTransRepUR ``hdf-parallel`` 0
   THEN RW LiftAllC 0
   THEN Reduce 0
   THEN UnrollLoopsOnceExcept ``cbva_seq mk_lambdas_fun select_fun_last partial_ap bag-append pi1 pi2``
   THEN (RWO "cbva_seq-spread" THENA Auto)
   THEN (RWO "cbva_seq_extend" THENA Auto)
   THEN RepUR ``ifthenelse lt_int btrue eq_int`` 0
   THEN RW LiftAllC 0
   THEN Reduce 0
   THEN Fold `select_fun_last` 0
   THEN RepeatFor ((MemCD THEN Try (Complete (Auto))))
   THEN Refine `sqequalSqle` []
   THEN OneFixpointLeast
   THEN RepeatFor (MoveToConcl (-2))
   THEN NatInd (-1)
   THEN (UnivCD THENA Auto)
   THEN Try ((ThinVar `j' THEN UnrollLoopsOnce THEN Strictness THEN Auto))
   THEN (RWO "fun_exp_unroll" THENA Auto)
   THEN AutoSplit) }

1
1. : ℤ
2. j ≠ 0
3. 0 < j
4. ∀L,G,H,S,init,out:Top. ∀m:ℕ. ∀a,g:Base.
     mk-hdf,s0. let X,Y s0 
                  in case X
                      of inl(y) =>
                      inl a.let X',xs 
                              in case Y
                                  of inl(P) =>
                                  let Y',ys 
                                  in let out ←─ xs ys
                                     in <mk-hdf <X', Y'>out>
                                  inr(P) =>
                                  let out ←─ xs Ax
                                  in <mk-hdf <X', inr Ax >out>)
                      inr(y) =>
                      case of inl(y) => inl a.let Y',ys in let out ←─ ys in <mk-hdf <inr Ax Y'>out>inr\000C(y) => inr Ax ^j 
      ⊥ 
      <inr Ax 
      case partial_ap(g;m 1;m) init
         of inl() =>
         fix((λmk-hdf,s. (inl a.cbva_seq(L a; λg.<case of inl() => mk-hdf (S s) inr() => inr Ax g>;
                                           m))))) 
         (S partial_ap(g;m 1;m) init)
         inr() =>
         inr Ax 
      > ≤ case partial_ap(g;m 1;m) init
       of inl() =>
       fix((λmk-hdf,s. (inl a.cbva_seq(λn.if n=m
                                               then case fst(s)
                                                     of inl(x) =>
                                                     mk_lambdas_fun(λg.(out (G g));m)
                                                     inr(x) =>
                                                     mk_lambdas_fun(λg.(G g);m)
                                               else (L (snd(s)) n); λg.<case partial_ap(g;m 1;m) (snd(s))
                                                                           of inl() =>
                                                                           mk-hdf 
                                                                           <inr Ax partial_ap(g;m 1;m) (snd(s))>
                                                                           inr() =>
                                                                           inr Ax 
                                                                         select_fun_last(g;m)
                                                                         >1))))) 
       <inr Ax partial_ap(g;m 1;m) init>
       inr() =>
       inr Ax )
5. Top@i
6. Top@i
7. Top@i
8. Top@i
9. init Top@i
10. out Top@i
11. : ℕ@i
12. Base@i
13. Base@i
⊢ case case partial_ap(g;m 1;m) init
        of inl() =>
        fix((λmk-hdf,s. (inl a.cbva_seq(L a; λg.<case of inl() => mk-hdf (S s) inr() => inr Ax g>;
                                          m))))) 
        (S partial_ap(g;m 1;m) init)
        inr() =>
        inr Ax 
   of inl(y) =>
   inl a.let Y',ys 
           in let out ←─ ys
              in <λmk-hdf,s0. let X,Y s0 
                              in case X
                                  of inl(y) =>
                                  inl a.let X',xs 
                                          in case Y
                                              of inl(P) =>
                                              let Y',ys 
                                              in let out ←─ xs ys
                                                 in <mk-hdf <X', Y'>out>
                                              inr(P) =>
                                              let out ←─ xs Ax
                                              in <mk-hdf <X', inr Ax >out>)
                                  inr(y) =>
                                  case Y
                                   of inl(y) =>
                                   inl a.let Y',ys 
                                           in let out ←─ ys
                                              in <mk-hdf <inr Ax Y'>out>)
                                   inr(y) =>
                                   inr Ax ^j 
                  ⊥ 
                  <inr Ax Y'>
                 out
                 >)
   inr(y) =>
   inr Ax  ≤ case partial_ap(g;m 1;m) init
   of inl() =>
   fix((λmk-hdf,s. (inl a.cbva_seq(λn.if n=m
                                           then case fst(s)
                                                 of inl(x) =>
                                                 mk_lambdas_fun(λg.(out (G g));m)
                                                 inr(x) =>
                                                 mk_lambdas_fun(λg.(G g);m)
                                           else (L (snd(s)) n); λg.<case partial_ap(g;m 1;m) (snd(s))
                                                                       of inl() =>
                                                                       mk-hdf 
                                                                       <inr Ax partial_ap(g;m 1;m) (snd(s))>
                                                                       inr() =>
                                                                       inr Ax 
                                                                     select_fun_last(g;m)
                                                                     >1))))) 
   <inr Ax partial_ap(g;m 1;m) init>
   inr() =>
   inr Ax 

2
1. : ℤ
2. j ≠ 0
3. 0 < j
4. ∀L,G,H,S,init,out:Top. ∀m:ℕ. ∀a,g:Base.
     (case partial_ap(g;m 1;m) init
       of inl() =>
       λmk-hdf,s. (inl a.cbva_seq(λn.if n=m
                                          then case fst(s)
                                                of inl(x) =>
                                                mk_lambdas_fun(λg.(out (G g));m)
                                                inr(x) =>
                                                mk_lambdas_fun(λg.(G g);m)
                                          else (L (snd(s)) n); λg.<case partial_ap(g;m 1;m) (snd(s))
                                                                      of inl() =>
                                                                      mk-hdf <inr Ax partial_ap(g;m 1;m) (snd(s))>
                                                                      inr() =>
                                                                      inr Ax 
                                                                    select_fun_last(g;m)
                                                                    >1)))^j 
       ⊥ 
       <inr Ax partial_ap(g;m 1;m) init>
       inr() =>
       inr Ax  ≤ fix((λmk-hdf,s0. let X,Y s0 
                                  in case X
                                      of inl(y) =>
                                      inl a.let X',xs 
                                              in case Y
                                                  of inl(P) =>
                                                  let Y',ys 
                                                  in let out ←─ xs ys
                                                     in <mk-hdf <X', Y'>out>
                                                  inr(P) =>
                                                  let out ←─ xs Ax
                                                  in <mk-hdf <X', inr Ax >out>)
                                      inr(y) =>
                                      case Y
                                       of inl(y) =>
                                       inl a.let Y',ys 
                                               in let out ←─ ys
                                                  in <mk-hdf <inr Ax Y'>out>)
                                       inr(y) =>
                                       inr Ax )) 
                 <inr Ax 
                 case partial_ap(g;m 1;m) init
                    of inl() =>
                    fix((λmk-hdf,s. (inl a.cbva_seq(L a; λg.<case s
                                                                  of inl() =>
                                                                  mk-hdf (S s)
                                                                  inr() =>
                                                                  inr Ax 
                                                                g
                                                                >m))))) 
                    (S partial_ap(g;m 1;m) init)
                    inr() =>
                    inr Ax 
                 >)
5. Top@i
6. Top@i
7. Top@i
8. Top@i
9. init Top@i
10. out Top@i
11. : ℕ@i
12. Base@i
13. Base@i
⊢ case partial_ap(g;m 1;m) init
   of inl() =>
   inl a.cbva_seq(λn.if n=m  then mk_lambdas_fun(λg.(G g);m)  else (L (S partial_ap(g;m 1;m) init) n);
                    λg@0.<case partial_ap(g@0;m 1;m) (S partial_ap(g;m 1;m) init)
                           of inl() =>
                           λmk-hdf,s. (inl a.cbva_seq(λn.if n=m
                                                              then case fst(s)
                                                                    of inl(x) =>
                                                                    mk_lambdas_fun(λg.(out (G g));m)
                                                                    inr(x) =>
                                                                    mk_lambdas_fun(λg.(G g);m)
                                                              else (L (snd(s)) n); λg.<case partial_ap(g;m 1;m) 
                                                                                              (snd(s))
                                                                                          of inl() =>
                                                                                          mk-hdf 
                                                                                          <inr Ax 
                                                                                          partial_ap(g;m 1;m) 
                                                                                            (snd(s))
                                                                                          >
                                                                                          inr() =>
                                                                                          inr Ax 
                                                                                        select_fun_last(g;m)
                                                                                        >1)))^j 
                           ⊥ 
                           <inr Ax partial_ap(g@0;m 1;m) (S partial_ap(g;m 1;m) init)>
                           inr() =>
                           inr Ax 
                         select_fun_last(g@0;m)
                         >1))
   inr() =>
   inr Ax  ≤ fix((λmk-hdf,s0. let X,Y s0 
                              in case X
                                  of inl(y) =>
                                  inl a.let X',xs 
                                          in case Y
                                              of inl(P) =>
                                              let Y',ys 
                                              in let out ←─ xs ys
                                                 in <mk-hdf <X', Y'>out>
                                              inr(P) =>
                                              let out ←─ xs Ax
                                              in <mk-hdf <X', inr Ax >out>)
                                  inr(y) =>
                                  case Y
                                   of inl(y) =>
                                   inl a.let Y',ys 
                                           in let out ←─ ys
                                              in <mk-hdf <inr Ax Y'>out>)
                                   inr(y) =>
                                   inr Ax )) 
             <inr Ax 
             case partial_ap(g;m 1;m) init
                of inl() =>
                fix((λmk-hdf,s. (inl a.cbva_seq(L a; λg.<case of inl() => mk-hdf (S s) inr() => inr Ax 
                                                            g
                                                            >m))))) 
                (S partial_ap(g;m 1;m) init)
                inr() =>
                inr Ax 
             >


Latex:


\mforall{}[L,G,H,S,init,out:Top].  \mforall{}[m:\mBbbN{}].
    (inl  (\mlambda{}a.<inr  Ax  ,  out>)  ||  fix((\mlambda{}mk-hdf,s.  (inl  (\mlambda{}a.cbva\_seq(L[s;a];  \mlambda{}g.<case  H[g;s]
                                                                                                                                                          of  inl()  =>
                                                                                                                                                          mk-hdf  S[g;s]
                                                                                                                                                          |  inr()  =>
                                                                                                                                                          inr  Ax 
                                                                                                                                                      ,  G[g]
                                                                                                                                                      >  m))))) 
                                                            init 
    \msim{}  fix((\mlambda{}mk-hdf,s.  (inl  (\mlambda{}a.cbva\_seq(\mlambda{}n.if  (n  =\msubz{}  m)
                                                                                  then  case  fst(s)
                                                                                              of  inl(x)  =>
                                                                                              mk\_lambdas\_fun(\mlambda{}g.(out  +  G[g]);m)
                                                                                              |  inr(x)  =>
                                                                                              mk\_lambdas\_fun(\mlambda{}g.G[g];m)
                                                                                  else  L[snd(s);a]  n
                                                                                  fi  ;  \mlambda{}g.<case  H[partial\_ap(g;m  +  1;m);snd(s)]
                                                                                                      of  inl()  =>
                                                                                                      mk-hdf  <inr  Ax  ,  S[partial\_ap(g;m  +  1;m);snd(s)]>
                                                                                                      |  inr()  =>
                                                                                                      inr  Ax 
                                                                                                  ,  select\_fun\_last(g;m)
                                                                                                  >  m  +  1))))) 
        <inl  Ax,  init>)


By

(Auto
  THEN  ProcTransRepUR  ``hdf-parallel``  0
  THEN  RW  LiftAllC  0
  THEN  Reduce  0
  THEN  ...
  THEN  (RWO  "cbva\_seq-spread"  0  THENA  Auto)
  THEN  (RWO  "cbva\_seq\_extend"  0  THENA  Auto)
  THEN  RepUR  ``ifthenelse  lt\_int  btrue  eq\_int``  0
  THEN  RW  LiftAllC  0
  THEN  Reduce  0
  THEN  Fold  `select\_fun\_last`  0
  THEN  RepeatFor  3  ((MemCD  THEN  Try  (Complete  (Auto))))
  THEN  Refine  `sqequalSqle`  []
  THEN  OneFixpointLeast
  THEN  RepeatFor  9  (MoveToConcl  (-2))
  THEN  NatInd  (-1)
  THEN  (UnivCD  THENA  Auto)
  THEN  Try  ((ThinVar  `j'  THEN  UnrollLoopsOnce  THEN  Strictness  THEN  Auto))
  THEN  (RWO  "fun\_exp\_unroll"  0  THENA  Auto)
  THEN  AutoSplit)




Home Index