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 2394 - (download) (annotate)
Fri Jun 21 02:28:07 2013 UTC (6 years, 4 months ago) by cchiw
File size: 1632 byte(s)
name changes
(* 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
  end

functor EinRepFn (I : EIN_INDEX_REP) =
  struct

    type field_id = int
    type tensor_id = int
    type index_id = int
    type var = Var.var
  
    type index_kind = I.index_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
      }


    (*This will need to use types from types.sml*)
 (* and tensor_type= T_Tensor of int list
    and param_kind = TEN of tensor_type | FLD of tensor_type
*)

and param_kind = TEN  | FLD 

and ein_exp
      = Const of real
      | Tensor of tensor_id * multiindex
      | Field of field_id * multiindex
      | Add of ein_exp list
      | Sum of int * ein_exp
      | Prod of ein_exp list
      | Div of ein_exp * ein_exp
      | Sub of ein_exp * ein_exp
      | Neg of ein_exp
      | Delta of delta
      | Epsilon of index_id * index_id * index_id
      | Conv of var * delta list * var * index_id
      | Partial of multiindex 
      | Probe of ein_exp * tensor_id (* Position is a tensor ID*)
      | Inside of ein_exp * tensor_id (* Position is a tensor ID*)
      | Apply of ein_exp * ein_exp (*newbie-need to restrict later*)
    withtype multiindex = index_id list
         and delta = index_id * index_id

  end

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