Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/charisee/src/compiler/einTest/Ex.sml
ViewVC logotype

View of /branches/charisee/src/compiler/einTest/Ex.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2521 - (download) (annotate)
Thu Jan 9 02:17:07 2014 UTC (5 years, 8 months ago) by cchiw
File size: 5107 byte(s)
Added type Checker
(* Split Functions before code generation process*)
structure Ex = struct
    local
    structure E = Ein
    in




val x1=E.EIN{params=[E.FLD(2),E.TEN 1 ,E.TEN 1,E.TEN 1,E.FLD(3)],index=[],
body=E.Add[E.Tensor(2,[]),E.Prod[E.Tensor(3,[]),E.Tensor(2,[])],E.Prod[E.Tensor(1,[]),E.Tensor(3,[])],E.Tensor(2,[]),E.Tensor(1,[])]}


val x2=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[],body=E.Sub(E.Tensor(2,[]),E.Sub(E.Prod[E.Tensor(3,[]),E.Tensor(2,[])], E.Tensor(0,[])))}

val x3=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1],index=[],body=E.Sub(E.Tensor(0,[]),E.Sub(E.Tensor(1,[]),E.Tensor(2,[])))}

val x4=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1],index=[],body=E.Sub(E.Sub(E.Tensor(0,[]),E.Tensor(1,[])),E.Tensor(2,[]))}

val x5=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[],body=E.Sub(E.Sub(E.Tensor(0,[]),E.Tensor(1,[])),E.Sub(E.Tensor(2,[]),E.Tensor(3,[])))}
val x6=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[],body=E.Div(E.Sub(E.Tensor(0,[]),E.Tensor(1,[])),E.Sub(E.Tensor(2,[]),E.Tensor(3,[]))) }

val d0=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[],body=E.Div(E.Tensor(0,[]),E.Div(E.Tensor(1,[]),E.Tensor(2,[]))) }
val d1=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[],body=E.Div(E.Div(E.Tensor(0,[]),E.Tensor(1,[])),E.Tensor(2,[])) }
val d2=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[1],body=E.Div(E.Div(E.Tensor(0,[E.V 0]),E.Tensor(1,[])),E.Div(E.Tensor(3,[]),E.Tensor(2,[]))) }

val p0=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[1,2],body=E.Prod[E.Div(E.Tensor(0,[E.V 0]),E.Tensor(1,[])),E.Div(E.Tensor(3,[E.V 1]),E.Tensor(2,[]) ), E.Tensor(1,[E.V 0])]}

val p1=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0,1,2,3],body=E.Prod[E.Div(E.Tensor(0,[E.V 0,E.V 2]),E.Tensor(1,[])),E.Div(E.Tensor(3,[E.V 1,E.V 3]),E.Tensor(2,[]) ), E.Tensor(1,[E.V 0,E.V 3])] }

val p2=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0,1,2,3],body=E.Prod[
        E.Prod[E.Tensor(0,[E.V 0,E.V 2]),E.Tensor(1,[])],
        E.Div(E.Tensor(3,[E.V 1,E.V 3]),E.Tensor(2,[])),
        E.Sub(E.Const 9.8, E.Const 8.0),
        E.Tensor(1,[E.V 0,E.V 3])] }


val p3=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0,1],body=E.Prod[E.Div(E.Tensor(0,[E.V 0]),E.Tensor(1,[])),E.Tensor(0,[E.V 1]),E.Tensor(0,[E.V 2]),
E.Sum([(E.V 3, 0, 2),(E.V 4, 0, 2)],E.Prod[E.Tensor(3,[E.V 1,E.V 3,E.V 4]),E.Tensor(2,[E.V 0,E.V 3, E.V 4]) ])]}

val p3=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0,1],body=E.Prod[
E.Sum([(E.V 2, 0, 2)],E.Prod[E.Tensor(0,[E.V 2]),E.Tensor(1,[E.V 2]) ]),
E.Sum([(E.V 2, 0, 2)],E.Prod[E.Tensor(0,[E.V 0,E.V 2]),E.Tensor(1,[E.V 2]) ]),
E.Sum([(E.V 2, 0, 2)],E.Prod[E.Tensor(0,[E.V 1,E.V 2]),E.Tensor(1,[E.V 2]),
E.Sum([(E.V 3, 0, 2)],E.Prod[E.Tensor(3,[E.V 2,E.V 3]),E.Tensor(2,[E.V 1,E.V 2, E.V 3]) ])]

)]}



val p4=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0,1],body=E.Prod[
E.Sum([(E.V 2, 0, 2)],E.Prod[E.Tensor(0,[E.V 2]),E.Tensor(1,[E.V 2]) ]),
E.Sum([(E.V 2, 0, 2)],E.Prod[E.Tensor(0,[E.V 0,E.V 2]),E.Tensor(1,[E.V 2]) ]),
E.Sum([(E.V 3, 0, 2)],E.Prod[E.Tensor(0,[E.V 3,E.V 0]),E.Tensor(1,[E.V 3]),
E.Sum([(E.V 4, 0, 2)],E.Prod[E.Tensor(3,[E.V 3,E.V 4]),E.Tensor(2,[E.V 4, E.V 3]) ])]

)]}


val p3=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0,1],body=E.Prod[E.Div(E.Tensor(0,[E.V 0]),E.Tensor(1,[])),E.Tensor(0,[E.V 1]),E.Tensor(0,[E.V 2]),
E.Sum([(E.V 3, 0, 2),(E.V 4, 0, 2)],E.Prod[E.Tensor(3,[E.V 1,E.V 3,E.V 4]),E.Tensor(2,[E.V 0,E.V 3, E.V 4]) ])]}






val a0=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0,1],body=E.Neg(E.Prod[E.Tensor(3,[E.V 1,E.V 3,E.V 4]),E.Tensor(2,[E.V 0,E.V 3, E.V 4]) ])}



val s0=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0],
       body= E.Sum([(E.V 1,0,9)],E.Prod[E.Tensor(0,[E.V 0,E.V 1]),
            E.Sum([(E.V 2, 0, 9)],E.Prod[E.Tensor(1,[E.V 2] ), E.Tensor(2,[E.V 2, E.V 1])]) ])}

val s1=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0],
body=E.Sum([(E.V 1,0,9),(E.V 2,0,8)],E.Prod[E.Tensor(0,[E.V 0,E.V 1]),E.Tensor(3,[E.V 1,E.V 2]),
E.Sum([(E.V 3, 0, 9)],E.Prod[E.Tensor(1,[E.V 3] ), E.Tensor(2,[E.V 3, E.V 2])]) ])}


val s2=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0],
body=E.Sum([(E.V 2,0,9),(E.V 3,0,8)],E.Prod[E.Tensor(0,[E.V 0,E.V 2]),E.Tensor(3,[E.V 2,E.V 3]),
E.Sum([(E.V 4, 0, 9)],E.Prod[E.Tensor(1,[E.V 4] ), E.Tensor(2,[E.V 3, E.V 4])]) ])}

val s3=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0],
body=E.Sum([(E.V 1,0,9),(E.V 2,0,8)],E.Prod[E.Tensor(0,[E.V 0,E.V 1]),E.Tensor(3,[E.V 1,E.V 2]),
E.Sum([(E.V 5, 0, 9)],E.Prod[E.Tensor(1,[E.V 5] ), E.Tensor(2,[E.V 5, E.V 2])]) ])}

val s5=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0],
body=E.Sum([(E.V 1,0,9)],E.Prod[E.Tensor(0,[E.V 0,E.V 1]),E.Tensor(3,[E.V 1]),
E.Sum([(E.V 2, 0, 8),(E.V 5, 0, 9)],E.Prod[E.Epsilon(0,2,5),E.Tensor(1,[E.V 5] ), E.Tensor(2,[E.V 2])]) ])}

val s4=E.EIN{params=[E.TEN 1,E.TEN 1,E.TEN 1,E.TEN 1],index=[0,1],
body=E.Prod[E.Tensor(0,[E.V 0]),E.Tensor(3,[]),
E.Sum([(E.V 2, 0, 8),(E.V 5, 0, 9)],E.Prod[E.Epsilon(1,2,5),E.Tensor(1,[E.V 5,E.V 2] ), E.Tensor(2,[E.V 2])]) ]}

end (* local *)

end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0