let eq = (==);;
+let compare (Ref (u1,s1)) (Ref (u2,s2)) =
+ let res = NUri.compare u1 u2 in
+ if res = 0 then compare s1 s2 else res
+;;
+
module OrderedStrings =
struct
type t = string
- let compare (s1 : t) (s2 : t) = compare s1 s2
+ let compare (s1 : t) (s2 : t) = Pervasives.compare s1 s2
end
;;
let mk_constructor j = function
| Ref (u, Ind (_,i,l)) ->
reference_of_string (string_of_reference (Ref (u, Con (i,j,l))))
- | _ -> assert false
+ | r ->
+ raise (IllFormedReference (lazy ("NON INDUCTIVE TYPE REFERENCE: " ^
+ string_of_reference r)));
+;;
+let mk_indty b = function
+ | Ref (u, Con (i,_,l)) ->
+ reference_of_string (string_of_reference (Ref (u, Ind (b,i,l))))
+ | r ->
+ raise (IllFormedReference (lazy
+ ("NON INDUCTIVE TYPE CONSTRUCTOR REFERENCE: " ^ string_of_reference r)));
;;
let mk_fix i j = function
reference_of_string (string_of_reference (Ref (u, CoFix i)))
| _ -> assert false
;;
+
+let reference_of_spec u spec =
+ reference_of_string (string_of_reference (Ref (u, spec)))
+;;
+
+
+
+