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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/simple/simple-types.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/simple/simple-types.sml

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

revision 3441, Wed Nov 18 00:24:04 2015 UTC revision 3442, Thu Nov 19 16:24:22 2015 UTC
# Line 16  Line 16 
16        = T_Bool        = T_Bool
17        | T_Int        | T_Int
18        | T_String        | T_String
19        | T_Sequence of ty * dim  (* fixed-sized sequence of values *)        | T_Sequence of ty * int option   (* sequence of values; second argument is length *)
20        | T_DynSequence of ty     (* dynamically sized sequence of values *)        | T_Named of Atom.atom            (* strand type *)
21      (* convolution kernel; argument is number of levels of differentiation *)      (* convolution kernel; argument is number of levels of differentiation *)
22        | T_Kernel of diff        | T_Kernel of diff
23      (* scalars, vectors, matrices, etc.; argument is tensor shape *)      (* scalars, vectors, matrices, etc.; argument is tensor shape *)
# Line 47  Line 47 
47        | DIM of dim        | DIM of dim
48    
49      local      local
50        fun listToString fmt sep items = String.concatWith sep (List.map fmt items)        fun listToString fmt sep items = String.concatWithMap sep fmt items
51        val shapeToString = listToString Int.toString ","        val shapeToString = listToString Int.toString ","
52      in      in
53      fun toString ty = (case ty      fun toString ty = (case ty
54             of T_Bool => "bool"             of T_Bool => "bool"
55              | T_Int => "int"              | T_Int => "int"
56              | T_String => "string"              | T_String => "string"
57              | T_Sequence(ty, dim) => concat[toString ty, "{", Int.toString dim, "}"]              | T_Sequence(ty, NONE) => toString ty ^ "{}"
58              | T_DynSequence ty => toString ty ^ "{}"              | T_Sequence(ty, SOME dim) => concat[toString ty, "{", Int.toString dim, "}"]
59                | T_Named id => Atom.toString id
60              | T_Kernel n => "kernel#" ^ Int.toString n              | T_Kernel n => "kernel#" ^ Int.toString n
61              | T_Tensor[] => "real"              | T_Tensor[] => "real"
62              | T_Tensor[2] => "vec2"              | T_Tensor[2] => "vec2"
# Line 99  Line 100 
100              | Ty.T_Bool => T_Bool              | Ty.T_Bool => T_Bool
101              | Ty.T_Int => T_Int              | Ty.T_Int => T_Int
102              | Ty.T_String => T_String              | Ty.T_String => T_String
103              | Ty.T_Sequence(ty, dim) => T_Sequence(simplify ty, TU.monoDim dim)              | Ty.T_Sequence(ty, NONE) => T_Sequence(simplify ty, NONE)
104              | Ty.T_DynSequence ty => T_DynSequence(simplify ty)              | Ty.T_Sequence(ty, dim) => T_Sequence(simplify ty, SOME(TU.monoDim dim))
105                | Ty.T_Named id => T_Named id
106              | Ty.T_Kernel n => T_Kernel(TU.monoDiff n)              | Ty.T_Kernel n => T_Kernel(TU.monoDiff n)
107              | Ty.T_Tensor shape => T_Tensor(TU.monoShape shape)              | Ty.T_Tensor shape => T_Tensor(TU.monoShape shape)
108              | Ty.T_Image{dim, shape} => T_Image{              | Ty.T_Image{dim, shape} => T_Image{

Legend:
Removed from v.3441  
changed lines
  Added in v.3442

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