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

SCM Repository

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

Diff of /trunk/src/compiler/basis/basis-vars.sml

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

revision 1922, Sat Jun 23 11:25:39 2012 UTC revision 1923, Sat Jun 23 12:02:18 2012 UTC
# Line 223  Line 223 
223    
224    (***** non-overloaded operators, etc. *****)    (***** non-overloaded operators, etc. *****)
225    
226      val op_at = polyVar (N.op_at, all([DK, NK, SK],    (* C math functions *)
227        val mathFns : (MathFuns.name * Var.var) list = let
228              fun ty n = List.tabulate(MathFuns.arity n, fn _ => Ty.realTy) --> Ty.realTy
229              in
230                List.map (fn n => (n, monoVar(MathFuns.toAtom n, ty n))) MathFuns.allFuns
231              end
232    
233      (* pseudo-operator for probing a field *)
234        val op_probe = polyVar (N.op_at, all([DK, NK, SK],
235            fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let            fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let
236                val k = Ty.DiffVar(k, 0)                val k = Ty.DiffVar(k, 0)
237                val d = Ty.DimVar d                val d = Ty.DimVar d
# Line 261  Line 269 
269      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)
270    
271    (* functions *)    (* functions *)
     val fn_atan2 = monoVar (N.fn_atan2, [Ty.realTy, Ty.realTy] --> Ty.realTy)  
   
     val fn_cos = monoVar (N.fn_cos, [Ty.realTy] --> Ty.realTy)  
   
272      local      local
273        val crossTy = let        val crossTy = let
274              val t = tensor[N3]              val t = tensor[N3]
# Line 304  Line 308 
308                    [Ty.T_String] --> Ty.T_Image{dim=d, shape=dd}                    [Ty.T_String] --> Ty.T_Image{dim=d, shape=dd}
309                  end))                  end))
310    
     val fn_fmod = monoVar (N.fn_fmod, [Ty.realTy, Ty.realTy] --> Ty.realTy)  
   
     val fn_log10 = monoVar (N.fn_log10, [Ty.realTy] --> Ty.realTy)  
     val fn_ln = monoVar (N.fn_ln, [Ty.realTy] --> Ty.realTy)  
   
311      val fn_max = monoVar (N.fn_max, [Ty.realTy, Ty.realTy] --> Ty.realTy)      val fn_max = monoVar (N.fn_max, [Ty.realTy, Ty.realTy] --> Ty.realTy)
312      val fn_min = monoVar (N.fn_min, [Ty.realTy, Ty.realTy] --> Ty.realTy)      val fn_min = monoVar (N.fn_min, [Ty.realTy, Ty.realTy] --> Ty.realTy)
313    
# Line 346  Line 345 
345                    [matrix d] --> tensor[d]                    [matrix d] --> tensor[d]
346                  end))                  end))
347    
     val fn_sin = monoVar (N.fn_sin, [Ty.realTy] --> Ty.realTy)  
   
     val fn_sqrt = monoVar (N.fn_sqrt, [Ty.realTy] --> Ty.realTy)  
   
     val fn_tan = monoVar (N.fn_tan, [Ty.realTy] --> Ty.realTy)  
   
348      val fn_trace = polyVar (N.fn_trace, all([NK],      val fn_trace = polyVar (N.fn_trace, all([NK],
349              fn [Ty.DIM d] => [matrix(Ty.DimVar d)] --> Ty.realTy))              fn [Ty.DIM d] => [matrix(Ty.DimVar d)] --> Ty.realTy))
350    

Legend:
Removed from v.1922  
changed lines
  Added in v.1923

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