diff options
author | 2013-10-14 09:17:28 +0000 | |
---|---|---|
committer | 2013-10-14 09:17:28 +0000 | |
commit | 5407fbfe5c091e4d97d7a7fbe04941b860510f8e (patch) | |
tree | 4a8c35fd9ce388579328a694fb2c3a174cf0bf3a /plugins/cc | |
parent | 3f4e97e0b0e0ce0a38f128018caffc95b452b34c (diff) |
Avoid polymorphic comparison (plugins/cc).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16885 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/cc')
-rw-r--r-- | plugins/cc/ccalgo.ml | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/plugins/cc/ccalgo.ml b/plugins/cc/ccalgo.ml index c067b1c00..d618e8426 100644 --- a/plugins/cc/ccalgo.ml +++ b/plugins/cc/ccalgo.ml @@ -86,13 +86,28 @@ type pa_mark= module PacOrd = struct type t = pa_constructor - let compare = Pervasives.compare (** FIXME *) + let compare { cnode = cnode0; arity = arity0; args = args0 } + { cnode = cnode1; arity = arity1; args = args1 } = + let cmp = Pervasives.compare cnode0 cnode1 in + if cmp = 0 then + let cmp' = Pervasives.compare arity0 arity1 in + if cmp' = 0 then + Pervasives.compare args0 args1 + else + cmp' + else + cmp end module PafOrd = struct type t = pa_fun - let compare = Pervasives.compare (** FIXME *) + let compare { fsym = fsym0; fnargs = fnargs0 } { fsym = fsym1; fnargs = fnargs1 } = + let cmp = Pervasives.compare fsym0 fsym1 in + if cmp = 0 then + Pervasives.compare fnargs0 fnargs1 + else + cmp end module PacMap=Map.Make(PacOrd) @@ -218,7 +233,7 @@ module Termhash = Hashtbl.Make module Identhash = Hashtbl.Make (struct type t = Id.t - let equal = Pervasives.(=) + let equal = Id.equal let hash = Hashtbl.hash end) |