let are_alpha_convertible err f t1 t2 =
let rec aux f = function
| B.Sort (_, p1), B.Sort (_, p2)
- | B.LRef (_, p1), B.LRef (_, p2) ->
+ | B.LRef (_, p1), B.LRef (_, p2) ->
if p1 = p2 then f () else err ()
- | B.GRef (_, u1), B.GRef (_, u2) ->
+ | B.GRef (_, u1), B.GRef (_, u2) ->
if U.eq u1 u2 then f () else err ()
| B.Cast (_, v1, t1), B.Cast (_, v2, t2)
- | B.Appl (_, v1, t1), B.Appl (_, v2, t2) ->
+ | B.Appl (_, _, v1, t1), B.Appl (_, _, v2, t2) ->
let f _ = aux f (t1, t2) in
aux f (v1, v2)
- | B.Bind (_, b1, t1), B.Bind (_, b2, t2) ->
+ | B.Bind (_, b1, t1), B.Bind (_, b2, t2) ->
let f _ = aux f (t1, t2) in
aux_bind f (b1, b2)
- | _ -> err ()
+ | _ -> err ()
and aux_bind f = function
| B.Abbr v1, B.Abbr v2 -> aux f (v1, v2)
- | B.Abst (x1, n1, v1), B.Abst (x2, n2, v2) when x1 = x2 && n1 = n2 -> aux f (v1, v2)
+ | B.Abst (r1, n1, v1), B.Abst (r2, n2, v2) when r1 = r2 && n1 = n2 -> aux f (v1, v2)
| B.Void, B.Void -> f ()
| _ -> err ()
in
(* to share *)
let rec step st m r =
- if !G.trace >= sublevel then
+ if !G.ct >= sublevel then
log1 st (Printf.sprintf "entering R.step: l=%u, n=%s," m.l (match m.n with Some n -> string_of_int n | None -> "infinite")) m.e r;
match r with
| B.Sort (a, h) ->
| B.GRef (_, uri) ->
begin match BE.get_entity uri with
| _, _, _, E.Abbr v ->
- if m.n = None || !G.expand then begin
+ if !G.expand then begin
if !G.summary then O.add ~gdelta:1 ();
step st m v
end else
if !G.summary then O.add ~epsilon:1 ();
step st m t
end
- | B.Appl (_, v, t) ->
+ | B.Appl (_, _, v, t) ->
step st {m with s = (m.e, v) :: m.s} t
| B.Bind (a, B.Abst (false, n, w), t) ->
let i = tsteps m in
{m with e = e; l = l}
let rec ac_nfs st (m1, t1, r1) (m2, t2, r2) =
- if !G.trace >= level then log2 st "Now converting nfs" m1.e t1 m2.e t2;
+ if !G.ct >= level then log2 st "Now converting nfs" m1.e t1 m2.e t2;
match t1, r1, t2, r2 with
| B.Sort (_, h1), _, B.Sort (_, h2), _ ->
h1 = h2
in
list_and map (m1.s, m2.s)
+let rec ih_nfs st (m, t, r) =
+ match t, r with
+ | B.GRef _, Some v ->
+ if !G.summary then O.add ~gdelta:1 ();
+ ih st m v
+ | _ -> m, t
+
+and ih st m t = ih_nfs st (step st m t)
+
(* Interface functions ******************************************************)
let empty_rtm = {
let _, _, _, b = B.get m.e i in b
let xwhd st m n t =
- if !G.trace >= level then log1 st "Now scanning" m.e t;
- let m, t, _ = step st (reset m n) t in
- m, t
+ if !G.ct >= level then log1 st "Now scanning" m.e t;
+ ih st (reset m n) t
let are_convertible st m1 n1 t1 m2 n2 t2 =
- if !G.trace >= level then log2 st "Now converting" m1.e t1 m2.e t2;
+ if !G.ct >= level then log2 st "Now converting" m1.e t1 m2.e t2;
let r = ac st (reset m1 n1) t1 (reset m2 n2) t2 in
r
(* let err _ = in