(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* begin match c1, c2 with | Pos, Pos | Null, Null -> 0 | Pos, Null -> -1 | Null, Pos -> 1 end | Type u1, Type u2 -> Universe.compare u1 u2 | Prop _, Type _ -> -1 | Type _, Prop _ -> 1 let equal s1 s2 = Int.equal (compare s1 s2) 0 let is_prop = function | Prop Null -> true | _ -> false let family = function | Prop Null -> InProp | Prop Pos -> InSet | Type _ -> InType let family_equal = (==) open Hashset.Combine let hash = function | Prop p -> let h = match p with | Pos -> 0 | Null -> 1 in combinesmall 1 h | Type u -> let h = Universe.hash u in combinesmall 2 h module List = struct let mem = List.memq let intersect l l' = CList.intersect family_equal l l' end module Hsorts = Hashcons.Make( struct type _t = t type t = _t type u = universe -> universe let hashcons huniv = function | Type u -> Type (huniv u) | 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 = hash end) let hcons = Hashcons.simple_hcons Hsorts.generate hcons_univ