aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/sorts.ml
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-08-22 14:29:31 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-08-22 14:29:31 +0000
commit9abbc22bd4001082681bffb881077a66e658a23a (patch)
tree8c68741543462dcf2e6fe7feeb8f7a907b409c5c /kernel/sorts.ml
parentd475ff0d4427fc1c3859fc5d8d0cb7cc0a32a14e (diff)
More complete hashcons : lists (dirpath), arrays (constr)
Earlier, the elements of constr arrays were hash-consed, but not the array itself. This helps a bit when the same (f a1 ... an) is manipulated a lot : -20% in the size of opaque terms in Integral_domain.vo and Nsatz.vo Similarly it's interesting to hash-cons sub-lists for dirpaths, since in Coq.A.B and Coq.A.C we could share Coq.A. With this patch, the hash-consing of constr seems quasi-optimal: Pierre-Marie's marshal compactor is unable to shrink opaque tables by more than 2%, and this difference seems to be due to untyped compaction (for the compactor Rel 1 = Prop Pos). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16723 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel/sorts.ml')
-rw-r--r--kernel/sorts.ml11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/sorts.ml b/kernel/sorts.ml
index 7ab6b553a..88c99683e 100644
--- a/kernel/sorts.ml
+++ b/kernel/sorts.ml
@@ -51,13 +51,12 @@ module Hsorts =
type t = _t
type u = universe -> universe
let hashcons huniv = function
- Prop c -> Prop c
| Type u -> Type (huniv u)
- let equal s1 s2 =
- match (s1,s2) with
- (Prop c1, Prop c2) -> c1 == c2
- | (Type u1, Type u2) -> u1 == u2
- |_ -> false
+ | s -> s
+ let equal s1 s2 = match (s1,s2) with
+ | (Prop c1, Prop c2) -> c1 == c2
+ | (Type u1, Type u2) -> u1 == u2
+ |_ -> false
let hash = Hashtbl.hash
end)