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-rep-fn.sml
ViewVC logotype

View of /branches/charisee/src/compiler/ein/ein-rep-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2496 - (download) (annotate)
Tue Oct 29 05:29:46 2013 UTC (5 years, 10 months ago) by cchiw
File size: 1543 byte(s)
changes to high-to-mid
(* ein-rep-fn.sml
 *
 * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *
 * Generic representation of Einstein expressions.
 *)

signature EIN_INDEX_REP =
  sig
    type index_kind
    type param_kind
  end

functor EinRepFn (I : EIN_INDEX_REP) =
  struct

    type field_id = int
    type tensor_id = int
    type index_id = int
    type var = VarEin.var
  
    type index_kind = I.index_kind
    type param_kind  = I.param_kind 
    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 index= V of index_id
and const= C of int *)


and mu
    = V of index_id
    | C of int




and ein_exp
      = Const of real
      | Tensor of tensor_id * alpha
      | Field of field_id* alpha
      | Krn of tensor_id* (mu*mu) list * pos
      | Delta of mu * mu
      | Value of index_id
      | Epsilon of index_id * index_id * index_id
      | Sum of alpha * 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 field_id * alpha * tensor_id * alpha
      | Probe of ein_exp * ein_exp

      | Img of field_id*alpha*pos list 

      withtype alpha= mu list
      and pos=ein_exp

  end

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