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

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/basis/basis-vars.sml
ViewVC logotype

Diff of /branches/lamont/src/compiler/basis/basis-vars.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 169, Thu Jul 22 20:07:37 2010 UTC revision 435, Tue Oct 19 13:14:20 2010 UTC
# Line 1  Line 1 
1  (* basis-vars.sml  (* basis-vars.sml
2   *   *
3   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4   * All rights reserved.   * All rights reserved.
5   *   *
6   * This module defines the AST variables for the built in operators and functions.   * This module defines the AST variables for the built in operators and functions.
# Line 141  Line 141 
141                  [field(k, d, dd), tensor[d]] --> Ty.T_Tensor dd                  [field(k, d, dd), tensor[d]] --> Ty.T_Tensor dd
142                end))                end))
143    
144    (* NOTE: this should be overloaded to allow both v*h and h*v orders *)
145        val op_convolve = polyVar (N.op_convolve, all([DK, NK, SK],
146                fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let
147                    val k = Ty.DiffVar(k, 0)
148                    val d = Ty.DimVar d
149                    val dd = Ty.ShapeVar dd
150                    in
151                      [Ty.T_Image{dim=d, shape=dd}, Ty.T_Kernel k]
152                        --> field(k, d, dd)
153                    end))
154    
155      val op_D = polyVar (N.op_D, all([DK, NK, SK],      val op_D = polyVar (N.op_D, all([DK, NK, SK],
156            fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let            fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let
157                val k0 = Ty.DiffVar(k, 0)                val k0 = Ty.DiffVar(k, 0)
# Line 157  Line 168 
168    
169      val op_not = monoVar (N.op_not, [Ty.T_Bool] --> Ty.T_Bool)      val op_not = monoVar (N.op_not, [Ty.T_Bool] --> Ty.T_Bool)
170    
     val op_subscript = polyVar (N.op_subscript, all([SK, NK],  
           fn [Ty.SHAPE dd, Ty.DIM d] => let  
               val dd = Ty.ShapeVar dd  
               val d = Ty.DimVar d  
               in  
                 [Ty.T_Tensor(Ty.ShapeExt(dd, d)), Ty.T_Int]  
                   --> Ty.T_Tensor dd  
               end))  
   
171    (* functions *)    (* functions *)
172      val fn_CL = polyVar (N.fn_CL, ty([tensor[N3, N3]] --> Ty.realTy))      val fn_CL = monoVar (N.fn_CL, [tensor[N3, N3]] --> Ty.realTy)
173    
174    (* the following is depreciated in favor of the infix operator *)
175      val fn_convolve = polyVar (N.fn_convolve, all([DK, NK, SK],      val fn_convolve = polyVar (N.fn_convolve, all([DK, NK, SK],
176              fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let              fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let
177                  val k = Ty.DiffVar(k, 0)                  val k = Ty.DiffVar(k, 0)

Legend:
Removed from v.169  
changed lines
  Added in v.435

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