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

# SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/basis/basis-vars.sml
 [diderot] / branches / pure-cfg / src / compiler / basis / basis-vars.sml

# Diff of /branches/pure-cfg/src/compiler/basis/basis-vars.sml

revision 1068, Tue May 3 19:01:56 2011 UTC revision 1069, Tue May 3 20:08:02 2011 UTC
# Line 126  Line 126
126                [t, Ty.realTy] --> t                [t, Ty.realTy] --> t
127              end))              end))
128
129      (* exponentiation; we distinguish between integer and real exponents to allow x^2 to be compiled
130       * as x*x.
131       *)
132        val exp_ri = monoVar(N.op_exp, [Ty.realTy, Ty.T_Int] --> Ty.realTy)
133        val exp_rr = monoVar(N.op_exp, [Ty.realTy, Ty.realTy] --> Ty.realTy)
134
135        val convolve_vk = polyVar (N.op_convolve, all([DK, NK, SK],
136                fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let
137                    val k = Ty.DiffVar(k, 0)
138                    val d = Ty.DimVar d
139                    val dd = Ty.ShapeVar dd
140                    in
141                      [Ty.T_Image{dim=d, shape=dd}, Ty.T_Kernel k]
142                        --> field(k, d, dd)
143                    end))
144        val convolve_kv = polyVar (N.op_convolve, all([DK, NK, SK],
145                fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let
146                    val k = Ty.DiffVar(k, 0)
147                    val d = Ty.DimVar d
148                    val dd = Ty.ShapeVar dd
149                    in
150                      [Ty.T_Kernel k, Ty.T_Image{dim=d, shape=dd}]
151                        --> field(k, d, dd)
152                    end))
153
154      val lt_ii = monoVar(N.op_lt, [Ty.T_Int, Ty.T_Int] --> Ty.T_Bool)      val lt_ii = monoVar(N.op_lt, [Ty.T_Int, Ty.T_Int] --> Ty.T_Bool)
155      val lt_rr = monoVar(N.op_lt, [Ty.realTy, Ty.realTy] --> Ty.T_Bool)      val lt_rr = monoVar(N.op_lt, [Ty.realTy, Ty.realTy] --> Ty.T_Bool)
156      val lte_ii = monoVar(N.op_lte, [Ty.T_Int, Ty.T_Int] --> Ty.T_Bool)      val lte_ii = monoVar(N.op_lte, [Ty.T_Int, Ty.T_Int] --> Ty.T_Bool)
# Line 174  Line 199
199                  [t, t, Ty.realTy, Ty.realTy, Ty.realTy] --> t                  [t, t, Ty.realTy, Ty.realTy, Ty.realTy] --> t
200                end))                end))
201
(* exponentiation; we distinguish between interger and real exponents to allow x^2 to be compiled
* as x*x.
*)
val exp_ri = monoVar(N.op_exp, [Ty.realTy, Ty.T_Int] --> Ty.realTy)
val exp_rr = monoVar(N.op_exp, [Ty.realTy, Ty.realTy] --> Ty.realTy)

202    (***** non-overloaded operators, etc. *****)    (***** non-overloaded operators, etc. *****)
203
204      val op_at = polyVar (N.op_at, all([DK, NK, SK],      val op_at = polyVar (N.op_at, all([DK, NK, SK],
# Line 191  Line 210
210                  [field(k, d, dd), tensor[d]] --> Ty.T_Tensor dd                  [field(k, d, dd), tensor[d]] --> Ty.T_Tensor dd
211                end))                end))
212
(* NOTE: this should be overloaded to allow both v*h and h*v orders *)
val op_convolve = polyVar (N.op_convolve, all([DK, NK, SK],
fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let
val k = Ty.DiffVar(k, 0)
val d = Ty.DimVar d
val dd = Ty.ShapeVar dd
in
[Ty.T_Image{dim=d, shape=dd}, Ty.T_Kernel k]
--> field(k, d, dd)
end))

213      val op_D = polyVar (N.op_D, all([DK, NK, SK],      val op_D = polyVar (N.op_D, all([DK, NK, SK],
214            fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let            fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let
215                val k0 = Ty.DiffVar(k, 0)                val k0 = Ty.DiffVar(k, 0)

Legend:
 Removed from v.1068 changed lines Added in v.1069

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