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

SCM Repository

[diderot] Diff of /trunk/src/compiler/common/field-def.sml
ViewVC logotype

Diff of /trunk/src/compiler/common/field-def.sml

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

revision 164, Tue Jul 20 18:56:04 2010 UTC revision 165, Wed Jul 21 15:20:53 2010 UTC
# Line 35  Line 35 
35              norm fld              norm fld
36            end            end
37    
38      (* equality test for field definitions *)
39        fun same (CONV(img1, kern1), CONV(img2, kern2)) =
40              ImageInfo.same(img1, img2) andalso Kernel.same(kern1, kern2)
41          | same (DIFF(k1, fld1), DIFF(k2, fld2)) =
42              (k1 = k2) andalso same(fld1, fld2)
43          | same (NEG fld1, NEG fld2) = same(fld1, fld2)
44          | same (SUM(fld11, fld12), SUM(fld21, fld22)) =
45              same(fld11, fld21) andalso same(fld12, fld22)
46    
47      (* hash value *)
48        fun hash (CONV(img, kern)) = 0w3 * ImageInfo.hash img + Kernel.hash kern
49          | hash (DIFF(k, fld)) = Word.fromInt k * 0w17 + hash fld
50          | hash (NEG fld) = 0w3 * hash fld + 0w11
51          | hash (SUM(fld1, fld2)) = 0w7 * hash fld1 + hash fld2
52    
53    end    end

Legend:
Removed from v.164  
changed lines
  Added in v.165

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