]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/tactics/paramodulation/utils.ml
Moved paramodulation inside tactics.
[helm.git] / helm / ocaml / tactics / paramodulation / utils.ml
1 (* Copyright (C) 2005, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://cs.unibo.it/helm/.
24  *)
25
26 (* $Id$ *)
27
28 let debug = true;;
29
30 let debug_print s = if debug then prerr_endline (Lazy.force s);;
31
32 let print_metasenv metasenv =
33   String.concat "\n--------------------------\n"
34     (List.map (fun (i, context, term) ->
35                  (string_of_int i) ^ " [\n" ^ (CicPp.ppcontext context) ^
36                    "\n] " ^  (CicPp.ppterm term))
37        metasenv)
38 ;;
39
40
41
42
43 let print_subst ?(prefix="\n") subst =
44     String.concat prefix
45      (List.map
46        (fun (i, (c, t, ty)) ->
47           Printf.sprintf "?%d -> %s : %s" i
48             (CicPp.ppterm t) (CicPp.ppterm ty))
49        subst)
50 ;;  
51
52 type comparison = Lt | Le | Eq | Ge | Gt | Incomparable;;
53     
54 let string_of_comparison = function
55   | Lt -> "<"
56   | Le -> "<="
57   | Gt -> ">"
58   | Ge -> ">="
59   | Eq -> "="
60   | Incomparable -> "I"
61
62 module OrderedTerm =
63 struct
64   type t = Cic.term
65       
66   let compare = Pervasives.compare
67 end
68
69 module TermSet = Set.Make(OrderedTerm);;
70 module TermMap = Map.Make(OrderedTerm);;
71
72 let symbols_of_term term =
73   let module C = Cic in
74   let rec aux map = function
75     | C.Meta _ -> map
76     | C.Appl l ->
77         List.fold_left (fun res t -> (aux res t)) map l
78     | t ->
79         let map = 
80           try
81             let c = TermMap.find t map in
82             TermMap.add t (c+1) map
83           with Not_found ->
84             TermMap.add t 1 map
85         in
86         map
87   in
88   aux TermMap.empty term
89 ;;
90
91
92 let metas_of_term term =
93   let module C = Cic in
94   let rec aux = function
95     | C.Meta _ as t -> TermSet.singleton t
96     | C.Appl l ->
97         List.fold_left (fun res t -> TermSet.union res (aux t)) TermSet.empty l
98     | t -> TermSet.empty (* TODO: maybe add other cases? *)
99   in
100   aux term
101 ;;
102
103
104 (************************* rpo ********************************)
105 let number = [
106   UriManager.uri_of_string "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)",3;
107   UriManager.uri_of_string "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1/1)",6;
108   UriManager.uri_of_string "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1/2)",9;
109   HelmLibraryObjects.Peano.pred_URI, 12;
110   HelmLibraryObjects.Peano.plus_URI, 15;
111   HelmLibraryObjects.Peano.minus_URI, 18;
112   HelmLibraryObjects.Peano.mult_URI, 21
113   ]
114 ;;
115
116 let atomic t =
117   match t with
118       Cic.Const _ 
119     | Cic.MutInd _ 
120     | Cic.MutConstruct _ -> true
121     | _ -> false
122
123 let sig_order t1 t2 =
124   try
125     let u1 = CicUtil.uri_of_term t1 in
126     let u2 = CicUtil.uri_of_term t2 in  
127     let n1 = List.assoc u1 number in
128     let n2 = List.assoc u2 number in
129     if n1 < n2 then Lt
130     else if n1 > n2 then Gt
131     else 
132       begin
133         prerr_endline ("t1 = "^(CicPp.ppterm t1));
134         prerr_endline ("t2 = "^(CicPp.ppterm t2)); flush;
135         assert false
136       end
137   with 
138       Invalid_argument _ 
139     | Not_found -> Incomparable
140
141 let rec rpo t1 t2 =
142   let module C = Cic in 
143   match t1,t2 with 
144       C.Meta (_, _), C.Meta (_,_) -> Incomparable
145     | C.Meta (_,_) as t1,t2 when TermSet.mem t1 (metas_of_term t2)
146         -> Lt
147     | t1, (C.Meta (_,_) as t2) when TermSet.mem t2 (metas_of_term t1)
148         -> Gt
149     | C.Appl (h1::arg1),C.Appl (h2::arg2) when h1=h2 ->
150         (match lex arg1 arg2 with
151            | Lt when (check Gt t2 arg1) -> Lt 
152            | Gt when (check Gt t1 arg2) -> Gt
153            | _ -> Incomparable )
154     | C.Appl (h1::arg1),C.Appl (h2::arg2) -> 
155         (match sig_order h1 h2 with
156           | Lt when (check Gt t2 arg1) -> Lt 
157           | Gt when (check Gt t1 arg2) -> Gt
158           | _ -> Incomparable )
159     | C.Appl (h1::arg1), t2 when atomic t2 ->
160         (match sig_order h1 t2 with
161            | Lt when (check Gt t2 arg1) -> Lt 
162            | Gt -> Gt
163            | _ -> Incomparable )
164     | t1 , C.Appl (h2::arg2) when atomic t1 ->
165         (match sig_order t1 h2 with
166            | Lt -> Lt 
167            | Gt when (check Gt t1 arg2) -> Gt
168            | _ -> Incomparable )
169     | C.Appl [] , _ -> assert false 
170     | _ , C.Appl [] -> assert false
171     | _,_ -> Incomparable
172
173 and lex l1 l2 = 
174   match l1,l2 with
175       [],[] -> Incomparable
176     | [],_ -> assert false
177     | _, [] -> assert false
178     | a1::l1, a2::l2 when a1 = a2 -> lex l1 l2
179     | a1::_, a2::_ -> rpo a1 a2
180
181 and check o t l =
182   List.fold_left 
183     (fun b a -> b && (rpo t a = o)) 
184     true l
185 ;;
186
187
188 (*********************** fine rpo *****************************)
189
190 (* (weight of constants, [(meta, weight_of_meta)]) *)
191 type weight = int * (int * int) list;;
192
193 let string_of_weight (cw, mw) =
194   let s =
195     String.concat ", "
196       (List.map (function (m, w) -> Printf.sprintf "(%d,%d)" m w) mw)
197   in
198   Printf.sprintf "[%d; %s]" cw s
199
200
201 let weight_of_term ?(consider_metas=true) term =
202   let module C = Cic in
203   let vars_dict = Hashtbl.create 5 in
204   let rec aux = function
205     | C.Meta (metano, _) when consider_metas ->
206         (try
207            let oldw = Hashtbl.find vars_dict metano in
208            Hashtbl.replace vars_dict metano (oldw+1)
209          with Not_found ->
210            Hashtbl.add vars_dict metano 1);
211         0
212     | C.Meta _ -> 0 (* "variables" are lighter than constants and functions...*)
213                   
214     | C.Var (_, ens)
215     | C.Const (_, ens)
216     | C.MutInd (_, _, ens)
217     | C.MutConstruct (_, _, _, ens) ->
218         List.fold_left (fun w (u, t) -> (aux t) + w) 1 ens
219           
220     | C.Cast (t1, t2)
221     | C.Lambda (_, t1, t2)
222     | C.Prod (_, t1, t2)
223     | C.LetIn (_, t1, t2) ->
224         let w1 = aux t1 in
225         let w2 = aux t2 in
226         w1 + w2 + 1
227           
228     | C.Appl l -> List.fold_left (+) 0 (List.map aux l)
229         
230     | C.MutCase (_, _, outt, t, pl) ->
231         let w1 = aux outt in
232         let w2 = aux t in
233         let w3 = List.fold_left (+) 0 (List.map aux pl) in
234         w1 + w2 + w3 + 1
235           
236     | C.Fix (_, fl) ->
237         List.fold_left (fun w (n, i, t1, t2) -> (aux t1) + (aux t2) + w) 1 fl
238           
239     | C.CoFix (_, fl) ->
240         List.fold_left (fun w (n, t1, t2) -> (aux t1) + (aux t2) + w) 1 fl
241           
242     | _ -> 1
243   in
244   let w = aux term in
245   let l =
246     Hashtbl.fold (fun meta metaw resw -> (meta, metaw)::resw) vars_dict [] in
247   let compare w1 w2 = 
248     match w1, w2 with
249     | (m1, _), (m2, _) -> m2 - m1 
250   in 
251   (w, List.sort compare l) (* from the biggest meta to the smallest (0) *)
252 ;;
253
254
255 module OrderedInt = struct
256   type t = int
257
258   let compare = Pervasives.compare
259 end
260
261 module IntSet = Set.Make(OrderedInt)
262
263 let compute_equality_weight ty left right =
264   let metasw = ref 0 in
265   let weight_of t =
266     let w, m = (weight_of_term ~consider_metas:true t) in
267     metasw := !metasw + (2 * (List.length m));
268     w
269   in
270   (* Warning: the following let cannot be expanded since it forces the
271      right evaluation order!!!! *)
272   let w = (weight_of ty) + (weight_of left) + (weight_of right) in
273   w + !metasw
274 ;;
275
276
277 (* returns a "normalized" version of the polynomial weight wl (with type
278  * weight list), i.e. a list sorted ascending by meta number,
279  * from 0 to maxmeta. wl must be sorted descending by meta number. Example:
280  * normalize_weight 5 (3, [(3, 2); (1, 1)]) ->
281  *      (3, [(1, 1); (2, 0); (3, 2); (4, 0); (5, 0)]) *)
282 let normalize_weight maxmeta (cw, wl) =
283   let rec aux = function
284     | 0 -> []
285     | m -> (m, 0)::(aux (m-1))
286   in
287   let tmpl = aux maxmeta in
288   let wl =
289     List.sort
290       (fun (m, _) (n, _) -> Pervasives.compare m n)
291       (List.fold_left
292          (fun res (m, w) -> (m, w)::(List.remove_assoc m res)) tmpl wl)
293   in
294   (cw, wl)
295 ;;
296
297
298 let normalize_weights (cw1, wl1) (cw2, wl2) =
299   let rec aux wl1 wl2 =
300     match wl1, wl2 with
301     | [], [] -> [], []
302     | (m, w)::tl1, (n, w')::tl2 when m = n ->
303         let res1, res2 = aux tl1 tl2 in
304         (m, w)::res1, (n, w')::res2
305     | (m, w)::tl1, ((n, w')::_ as wl2) when m < n ->
306         let res1, res2 = aux tl1 wl2 in
307         (m, w)::res1, (m, 0)::res2
308     | ((m, w)::_ as wl1), (n, w')::tl2 when m > n ->
309         let res1, res2 = aux wl1 tl2 in
310         (n, 0)::res1, (n, w')::res2
311     | [], (n, w)::tl2 ->
312         let res1, res2 = aux [] tl2 in
313         (n, 0)::res1, (n, w)::res2
314     | (m, w)::tl1, [] ->
315         let res1, res2 = aux tl1 [] in
316         (m, w)::res1, (m, 0)::res2
317     | _, _ -> assert false
318   in
319   let cmp (m, _) (n, _) = compare m n in
320   let wl1, wl2 = aux (List.sort cmp wl1) (List.sort cmp wl2) in
321   (cw1, wl1), (cw2, wl2)
322 ;;
323
324         
325 let compare_weights ?(normalize=false)
326     ((h1, w1) as weight1) ((h2, w2) as weight2)=
327   let (h1, w1), (h2, w2) =
328     if normalize then
329       normalize_weights weight1 weight2
330     else
331       (h1, w1), (h2, w2)
332   in
333   let res, diffs =
334     try
335       List.fold_left2
336         (fun ((lt, eq, gt), diffs) w1 w2 ->
337            match w1, w2 with
338            | (meta1, w1), (meta2, w2) when meta1 = meta2 ->
339                let diffs = (w1 - w2) + diffs in 
340                let r = compare w1 w2 in
341                if r < 0 then (lt+1, eq, gt), diffs
342                else if r = 0 then (lt, eq+1, gt), diffs
343                else (lt, eq, gt+1), diffs
344            | (meta1, w1), (meta2, w2) ->
345                debug_print
346                  (lazy
347                     (Printf.sprintf "HMMM!!!! %s, %s\n"
348                        (string_of_weight weight1) (string_of_weight weight2)));
349                assert false)
350         ((0, 0, 0), 0) w1 w2
351     with Invalid_argument _ ->
352       debug_print
353         (lazy
354            (Printf.sprintf "Invalid_argument: %s{%s}, %s{%s}, normalize = %s\n"
355               (string_of_weight (h1, w1)) (string_of_weight weight1)
356               (string_of_weight (h2, w2)) (string_of_weight weight2)
357               (string_of_bool normalize)));
358       assert false
359   in
360   let hdiff = h1 - h2 in 
361   match res with
362   | (0, _, 0) ->
363       if hdiff < 0 then Lt
364       else if hdiff > 0 then Gt
365       else Eq (* Incomparable *)
366   | (m, _, 0) ->
367       if hdiff <= 0 then Lt
368       else if (- diffs) >= hdiff then Le else Incomparable
369   | (0, _, m) ->
370       if hdiff >= 0 then Gt
371       else if diffs >= (- hdiff) then Ge else Incomparable
372   | (m, _, n) when m > 0 && n > 0 ->
373       Incomparable
374   | _ -> assert false 
375
376 ;;
377
378
379 let rec aux_ordering ?(recursion=true) t1 t2 =
380   let module C = Cic in
381   let compare_uris u1 u2 =
382     let res =
383       compare (UriManager.string_of_uri u1) (UriManager.string_of_uri u2) in
384     if res < 0 then Lt
385     else if res = 0 then Eq
386     else Gt
387   in
388   match t1, t2 with
389   | C.Meta _, _
390   | _, C.Meta _ -> Incomparable
391
392   | t1, t2 when t1 = t2 -> Eq
393
394   | C.Rel n, C.Rel m -> if n > m then Lt else Gt
395   | C.Rel _, _ -> Lt
396   | _, C.Rel _ -> Gt
397
398   | C.Const (u1, _), C.Const (u2, _) -> compare_uris u1 u2
399   | C.Const _, _ -> Lt
400   | _, C.Const _ -> Gt
401
402   | C.MutInd (u1, _, _), C.MutInd (u2, _, _) -> compare_uris u1 u2
403   | C.MutInd _, _ -> Lt
404   | _, C.MutInd _ -> Gt
405
406   | C.MutConstruct (u1, _, _, _), C.MutConstruct (u2, _, _, _) ->
407       compare_uris u1 u2
408   | C.MutConstruct _, _ -> Lt
409   | _, C.MutConstruct _ -> Gt
410
411   | C.Appl l1, C.Appl l2 when recursion ->
412       let rec cmp t1 t2 =
413         match t1, t2 with
414         | [], [] -> Eq
415         | _, [] -> Gt
416         | [], _ -> Lt
417         | hd1::tl1, hd2::tl2 ->
418             let o = aux_ordering hd1 hd2 in
419             if o = Eq then cmp tl1 tl2
420             else o
421       in
422       cmp l1 l2
423   | C.Appl (h1::t1), C.Appl (h2::t2) when not recursion ->
424       aux_ordering h1 h2
425         
426   | t1, t2 ->
427       debug_print
428         (lazy
429            (Printf.sprintf "These two terms are not comparable:\n%s\n%s\n\n"
430               (CicPp.ppterm t1) (CicPp.ppterm t2)));
431       Incomparable
432 ;;
433
434
435 (* w1, w2 are the weights, they should already be normalized... *)
436 let nonrec_kbo_w (t1, w1) (t2, w2) =
437   match compare_weights w1 w2 with
438   | Le -> if aux_ordering t1 t2 = Lt then Lt else Incomparable
439   | Ge -> if aux_ordering t1 t2 = Gt then Gt else Incomparable
440   | Eq -> aux_ordering t1 t2
441   | res -> res
442 ;;
443
444     
445 let nonrec_kbo t1 t2 =
446   let w1 = weight_of_term t1 in
447   let w2 = weight_of_term t2 in
448   (* 
449   prerr_endline ("weight1 :"^(string_of_weight w1));
450   prerr_endline ("weight2 :"^(string_of_weight w2)); 
451   *)
452   match compare_weights ~normalize:true w1 w2 with
453   | Le -> if aux_ordering t1 t2 = Lt then Lt else Incomparable
454   | Ge -> if aux_ordering t1 t2 = Gt then Gt else Incomparable
455   | Eq -> aux_ordering t1 t2
456   | res -> res
457 ;;
458
459
460 let rec kbo t1 t2 =
461   let aux = aux_ordering ~recursion:false in
462   let w1 = weight_of_term t1
463   and w2 = weight_of_term t2 in
464   let rec cmp t1 t2 =
465     match t1, t2 with
466     | [], [] -> Eq
467     | _, [] -> Gt
468     | [], _ -> Lt
469     | hd1::tl1, hd2::tl2 ->
470         let o =
471           kbo hd1 hd2
472         in
473         if o = Eq then cmp tl1 tl2
474         else o
475   in
476   let comparison = compare_weights ~normalize:true w1 w2 in
477   match comparison with
478   | Le ->
479       let r = aux t1 t2 in
480       if r = Lt then Lt
481       else if r = Eq then (
482         match t1, t2 with
483         | Cic.Appl (h1::tl1), Cic.Appl (h2::tl2) when h1 = h2 ->
484             if cmp tl1 tl2 = Lt then Lt else Incomparable
485         | _, _ ->  Incomparable
486       ) else Incomparable
487   | Ge ->
488       let r = aux t1 t2 in
489       if r = Gt then Gt
490       else if r = Eq then (
491         match t1, t2 with
492         | Cic.Appl (h1::tl1), Cic.Appl (h2::tl2) when h1 = h2 ->
493             if cmp tl1 tl2 = Gt then Gt else Incomparable
494         | _, _ ->  Incomparable
495       ) else Incomparable
496   | Eq ->
497       let r = aux t1 t2 in
498       if r = Eq then (
499         match t1, t2 with
500         | Cic.Appl (h1::tl1), Cic.Appl (h2::tl2) when h1 = h2 ->
501             cmp tl1 tl2
502         | _, _ ->  Incomparable
503       ) else r 
504   | res -> res
505 ;;
506           
507 let rec ao t1 t2 =
508   let get_hd t =
509     match t with
510         Cic.MutConstruct(uri,tyno,cno,_) -> Some(uri,tyno,cno)
511       | Cic.Appl(Cic.MutConstruct(uri,tyno,cno,_)::_) -> 
512           Some(uri,tyno,cno)
513       | _ -> None in
514   let aux = aux_ordering ~recursion:false in
515   let w1 = weight_of_term t1
516   and w2 = weight_of_term t2 in
517   let rec cmp t1 t2 =
518     match t1, t2 with
519     | [], [] -> Eq
520     | _, [] -> Gt
521     | [], _ -> Lt
522     | hd1::tl1, hd2::tl2 ->
523         let o =
524           ao hd1 hd2
525         in
526         if o = Eq then cmp tl1 tl2
527         else o
528   in
529   match get_hd t1, get_hd t2 with
530       Some(_),None -> Lt
531     | None,Some(_) -> Gt
532     | _ ->
533         let comparison = compare_weights ~normalize:true w1 w2 in
534           match comparison with
535             | Le ->
536                 let r = aux t1 t2 in
537                   if r = Lt then Lt
538                   else if r = Eq then (
539                     match t1, t2 with
540                       | Cic.Appl (h1::tl1), Cic.Appl (h2::tl2) when h1 = h2 ->
541                           if cmp tl1 tl2 = Lt then Lt else Incomparable
542                       | _, _ ->  Incomparable
543                   ) else Incomparable
544             | Ge ->
545                 let r = aux t1 t2 in
546                   if r = Gt then Gt
547                   else if r = Eq then (
548                     match t1, t2 with
549                       | Cic.Appl (h1::tl1), Cic.Appl (h2::tl2) when h1 = h2 ->
550                           if cmp tl1 tl2 = Gt then Gt else Incomparable
551                       | _, _ ->  Incomparable
552                   ) else Incomparable
553             | Eq ->
554                 let r = aux t1 t2 in
555                   if r = Eq then (
556                     match t1, t2 with
557                       | Cic.Appl (h1::tl1), Cic.Appl (h2::tl2) when h1 = h2 ->
558                           cmp tl1 tl2
559                       | _, _ ->  Incomparable
560                   ) else r 
561             | res -> res
562 ;;
563
564 let names_of_context context = 
565   List.map
566     (function
567        | None -> None
568        | Some (n, e) -> Some n)
569     context
570 ;;
571
572
573 let rec lpo t1 t2 =
574   let module C = Cic in
575   match t1, t2 with
576   | t1, t2 when t1 = t2 -> Eq
577   | t1, (C.Meta _ as m) ->
578       if TermSet.mem m (metas_of_term t1) then Gt else Incomparable
579   | (C.Meta _ as m), t2 ->
580       if TermSet.mem m (metas_of_term t2) then Lt else Incomparable
581   | C.Appl (hd1::tl1), C.Appl (hd2::tl2) -> (
582       let res =
583         let f o r t =
584           if r then true else
585             match lpo t o with
586             | Gt | Eq -> true
587             | _ -> false
588         in
589         let res1 = List.fold_left (f t2) false tl1 in
590         if res1 then Gt
591         else let res2 = List.fold_left (f t1) false tl2 in
592         if res2 then Lt
593         else Incomparable
594       in
595       if res <> Incomparable then
596         res
597       else
598         let f o r t =
599           if not r then false else
600             match lpo o t with
601             | Gt -> true
602             | _ -> false
603         in
604         match aux_ordering hd1 hd2 with
605         | Gt ->
606             let res = List.fold_left (f t1) false tl2 in
607             if res then Gt
608             else Incomparable
609         | Lt ->
610             let res = List.fold_left (f t2) false tl1 in
611             if res then Lt
612             else Incomparable
613         | Eq -> (
614             let lex_res =
615               try
616                 List.fold_left2
617                   (fun r t1 t2 -> if r <> Eq then r else lpo t1 t2)
618                   Eq tl1 tl2
619               with Invalid_argument _ ->
620                 Incomparable
621             in
622             match lex_res with
623             | Gt ->
624                 if List.fold_left (f t1) false tl2 then Gt
625                 else Incomparable
626             | Lt ->
627                 if List.fold_left (f t2) false tl1 then Lt
628                 else Incomparable
629             | _ -> Incomparable
630           )
631         | _ -> Incomparable
632     )
633   | t1, t2 -> aux_ordering t1 t2
634 ;;
635
636
637 (* settable by the user... *)
638 (* let compare_terms = ref nonrec_kbo;; *)
639 (* let compare_terms = ref ao;; *)
640 let compare_terms = ref rpo;;
641
642 let guarded_simpl context t = t
643 (*
644   let t' = ProofEngineReduction.simpl context t in
645   let simpl_order = !compare_terms t t' in
646   if simpl_order = Gt then 
647     (* prerr_endline ("reduce: "^(CicPp.ppterm t)^(CicPp.ppterm t')); *)
648   t'
649   else t *)
650 ;;
651
652 type equality_sign = Negative | Positive;;
653
654 let string_of_sign = function
655   | Negative -> "Negative"
656   | Positive -> "Positive"
657 ;;
658
659
660 type pos = Left | Right 
661
662 let string_of_pos = function
663   | Left -> "Left"
664   | Right -> "Right"
665 ;;
666
667
668 let eq_ind_URI () = LibraryObjects.eq_ind_URI ~eq:(LibraryObjects.eq_URI ())
669 let eq_ind_r_URI () = LibraryObjects.eq_ind_r_URI ~eq:(LibraryObjects.eq_URI ())
670 let sym_eq_URI () = LibraryObjects.sym_eq_URI ~eq:(LibraryObjects.eq_URI ())
671 let eq_XURI () =
672   let s = UriManager.string_of_uri (LibraryObjects.eq_URI ()) in
673   UriManager.uri_of_string (s ^ "#xpointer(1/1/1)")
674 let trans_eq_URI () = LibraryObjects.trans_eq_URI ~eq:(LibraryObjects.eq_URI ())