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

SCM Repository

[diderot] Diff of /trunk/src/ast/meta-var.sml
ViewVC logotype

Diff of /trunk/src/ast/meta-var.sml

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

revision 80, Tue May 25 03:05:33 2010 UTC revision 81, Wed May 26 17:28:54 2010 UTC
# Line 33  Line 33 
33    
34    (***** Differentiation variables ****)    (***** Differentiation variables ****)
35    
36      fun newDiffVar () = DfV{      fun newDiffVar bnd = DfV{
37              id = Stamp.new(),              id = Stamp.new(),
38              bound = ref 0,              bound = ref bnd,
39              bind = ref NONE              bind = ref NONE
40            }            }
41    
# Line 69  Line 69 
69        | metaToString (SHAPE sv) = shapeVarToString sv        | metaToString (SHAPE sv) = shapeVarToString sv
70        | metaToString (DIM dv) = dimVarToString dv        | metaToString (DIM dv) = dimVarToString dv
71    
72        fun stamp (TYPE(TV{id, ...})) = id
73          | stamp (DIFF(DfV{id, ...})) = id
74          | stamp (SHAPE(SV{id, ...})) = id
75          | stamp (DIM(DV{id, ...})) = id
76    
77        fun copy (TYPE _) = TYPE(newTyVar())
78          | copy (DIFF(k as DfV{bound, ...})) = DIFF(newDiffVar(!bound))
79          | copy (SHAPE _) = SHAPE(newShapeVar())
80          | copy (DIM _) = DIM(newDimVar())
81    
82        structure Map = RedBlackMapFn (
83          struct
84            type ord_key = Types.meta_var
85            fun compare (mv1, mv2) = Stamp.compare(stamp mv1, stamp mv2)
86          end)
87    
88    end    end

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

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