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

SCM Repository

[diderot] Diff of /trunk/src/typechecker/util.sml
ViewVC logotype

Diff of /trunk/src/typechecker/util.sml

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

revision 81, Wed May 26 17:28:54 2010 UTC revision 82, Wed May 26 18:20:49 2010 UTC
# Line 139  Line 139 
139                    (mv'::mvs, MV.Map.insert(env, mv, mv'))                    (mv'::mvs, MV.Map.insert(env, mv, mv'))
140                  end                  end
141            val (mvs, env) = List.foldl instantiateVar ([], MV.Map.empty) mvs            val (mvs, env) = List.foldl instantiateVar ([], MV.Map.empty) mvs
142              fun iDiff (Ty.DiffVar(k, i)) = (case MV.Map.find(env, Ty.DIFF k)
143                     of SOME(Ty.DIFF k) => Ty.DiffVar(k, i)
144                      | _ => raise Fail "impossible"
145                    (* end case *))
146                | iDiff diff = diff
147              fun iDim (Ty.DimVar dv) = (case MV.Map.find(env, Ty.DIM dv)
148                     of SOME(Ty.DIM dv) => Ty.DimVar dv
149                      | _ => raise Fail "impossible"
150                    (* end case *))
151                | iDim dim = dim
152              fun iShape (Ty.ShapeVar sv) = (case MV.Map.find(env, Ty.SHAPE sv)
153                     of SOME(Ty.SHAPE sv) => Ty.ShapeVar sv
154                      | _ => raise Fail "impossible"
155                    (* end case *))
156                | iShape (Ty.ShapeExt(shape, dim)) = Ty.ShapeExt(iShape shape, iDim dim)
157                | iShape (Ty.Shape dims) = Ty.Shape(List.map iDim dims)
158            fun ity (Ty.T_Var tv) = (case MV.Map.find(env, Ty.TYPE tv)            fun ity (Ty.T_Var tv) = (case MV.Map.find(env, Ty.TYPE tv)
159                   of SOME(Ty.TYPE tv) => Ty.T_Var tv                   of SOME(Ty.TYPE tv) => Ty.T_Var tv
160                    | _ => raise Fail "impossible"                    | _ => raise Fail "impossible"
161                  (* end case *))                  (* end case *))
162                | ity (Ty.T_Kernel k) = Ty.T_Kernel(iDiff k)
163                | ity (Ty.T_Tensor shape) = Ty.T_Tensor(iShape shape)
164                | ity (Ty.T_Image{dim, shape}) = Ty.T_Image{dim=iDim dim, shape=iShape shape}
165                | ity (Ty.T_Field{diff, dim, shape}) =
166                    Ty.T_Field{diff=iDiff diff, dim=iDim dim, shape=iShape shape}
167                | ity (Ty.T_Fun(dom, rng)) = Ty.T_Fun(List.map ity dom, ity rng)
168                | ity ty = ty
169            in            in
170  raise Fail "unimplemented"              (mvs, ity ty)
171            end            end
172    
173    end    end

Legend:
Removed from v.81  
changed lines
  Added in v.82

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