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

SCM Repository

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

View of /branches/charisee/src/compiler/ein/ein.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2870 - (download) (annotate)
Wed Feb 25 21:47:43 2015 UTC (4 years, 5 months ago) by cchiw
File size: 1556 byte(s)
added sqrt,pow, and examples
structure Ein =
  struct

(*TEN 0-Don't Subst,shape of arguement *)
datatype param_kind = TEN of int *int list | FLD of int|KRN|IMG of int*int list 
type index_kind =int
type field_id = int
type tensor_id = int
type kernel_id = int
type image_id = int
type index_id = int
type var = VarEin.var

datatype ein = EIN of {
    params : param_kind list,
    (* Parameters to equation are either tensors or fields *)
    (* These variables are named using de Bruijn indexing *)
    index : index_kind list,	(* Index variables in the equation. *)
    body : ein_exp
}

and mu = V of index_id| C of int

and ein_exp
    = Const of int
    | Tensor of tensor_id * alpha
    | Field of field_id* alpha
    | Krn of kernel_id* (mu*mu) list * pos
    | Delta of mu * mu
    | Value of index_id (*Lift index*)
    | Epsilon of index_id * index_id * index_id
    | Eps2 of index_id * index_id 
    | Sum of (sumrange list) * ein_exp
    | Neg of ein_exp
    | Add of ein_exp list
    | Sub of ein_exp * ein_exp
    | Prod of ein_exp list
    | Div of ein_exp * ein_exp
    | Partial of alpha
    | Apply of ein_exp * ein_exp
    | Conv of image_id * alpha * kernel_id * alpha
    | Probe of ein_exp * ein_exp
    | Img of image_id*alpha*pos list
    | Lift of ein_exp
    | Sqrt of ein_exp
    | PowInt of ein_exp* int
    | PowReal of ein_exp* RationalEin.rat
    | ConstR of RationalEin.rat

    withtype alpha= mu list
    and pos=ein_exp
    and sumrange=mu*int*int

fun body(EIN{body,...})=body
fun params(EIN{params,...})=params
fun index(EIN{index,...})=index
end

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