autCrg: we removed the computation of the de Bruijn degree
output: we renamed some reductions to reflect the latest terminology
brgSubstitution: icm related bugfix
src/basic_rg/brgEnvironment.cmx: src/common/entity.cmx src/basic_rg/brg.cmx \
src/basic_rg/brgEnvironment.cmi
src/basic_rg/brgSubstitution.cmi: src/basic_rg/brg.cmx
src/basic_rg/brgEnvironment.cmx: src/common/entity.cmx src/basic_rg/brg.cmx \
src/basic_rg/brgEnvironment.cmi
src/basic_rg/brgSubstitution.cmi: src/basic_rg/brg.cmx
-src/basic_rg/brgSubstitution.cmo: src/basic_rg/brg.cmx \
+src/basic_rg/brgSubstitution.cmo: src/common/options.cmx src/basic_rg/brg.cmx \
src/basic_rg/brgSubstitution.cmi
src/basic_rg/brgSubstitution.cmi
-src/basic_rg/brgSubstitution.cmx: src/basic_rg/brg.cmx \
+src/basic_rg/brgSubstitution.cmx: src/common/options.cmx src/basic_rg/brg.cmx \
src/basic_rg/brgSubstitution.cmi
src/basic_rg/brgReduction.cmi: src/common/status.cmx src/lib/log.cmi \
src/common/entity.cmx src/basic_rg/brg.cmx
src/basic_rg/brgSubstitution.cmi
src/basic_rg/brgReduction.cmi: src/common/status.cmx src/lib/log.cmi \
src/common/entity.cmx src/basic_rg/brg.cmx
(* Internal functions *******************************************************)
(* Internal functions *******************************************************)
-let empty_cnt = [], [], []
-let add_abst (a, ws, ns) id w n =
- E.Name (id, true) :: a, w :: ws, N.succ n :: ns
+let add_abst (a, ws) id w =
+ E.Name (id, true) :: a, w :: ws
-let mk_lref f n i j k = f n (D.TLRef ([E.Apix k], i, j))
+let mk_lref f i j k = f (D.TLRef ([E.Apix k], i, j))
let id_of_name (id, _, _) = id
let id_of_name (id, _, _) = id
| Some qid -> let f qid = f (Some qid) in relax_qid f st qid
let resolve_gref err f st qid =
| Some qid -> let f qid = f (Some qid) in relax_qid f st qid
let resolve_gref err f st qid =
- try let n, cnt = K.find henv (uri_of_qid qid) in f n qid cnt
+ try let cnt = K.find henv (uri_of_qid qid) in f qid cnt
with Not_found -> err qid
let resolve_gref_relaxed f st qid =
with Not_found -> err qid
let resolve_gref_relaxed f st qid =
(****************************************************************************)
(****************************************************************************)
-let push_abst f (lenv, ns) a n w =
+let push_abst f lenv a w =
let bw = D.Abst (N.infinite, [w]) in
let bw = D.Abst (N.infinite, [w]) in
- let f lenv = f (lenv, N.succ n :: ns) in
-let resolve_lref err f id (lenv, ns) =
- let f i j k = f (List.nth ns k) i j k in
- D.resolve_lref err f id lenv
-
-let lenv_of_cnt (a, ws, ns) =
- D.push_bind C.start D.empty_lenv a (D.Abst (N.infinite, ws)), ns
+let lenv_of_cnt (a, ws) =
+ D.push_bind C.start D.empty_lenv a (D.Abst (N.infinite, ws))
(* this is not tail recursive in the GRef branch *)
let rec xlate_term f st lenv = function
| A.Sort s ->
(* this is not tail recursive in the GRef branch *)
let rec xlate_term f st lenv = function
| A.Sort s ->
- let f h = f (N.finite 0) (D.TSort ([], h)) in
+ let f h = f (D.TSort ([], h)) in
if s then f 0 else f 1
| A.Appl (v, t) ->
if s then f 0 else f 1
| A.Appl (v, t) ->
- let f vv n tt = f n (D.TAppl ([], [vv], tt)) in
- let f _ vv = xlate_term (f vv) st lenv t in
+ let f vv tt = f (D.TAppl ([], [vv], tt)) in
+ let f vv = xlate_term (f vv) st lenv t in
xlate_term f st lenv v
| A.Abst (name, w, t) ->
xlate_term f st lenv v
| A.Abst (name, w, t) ->
let a = [E.Name (name, true)] in
let a = [E.Name (name, true)] in
- let f nt tt =
- let nnt = N.infinite (* if N.is_zero nt then N.infinite else nt *) in
- let b = D.Abst (nnt, [ww]) in
- f nt (D.TBind (a, b, tt))
+ let f tt =
+ let b = D.Abst (N.infinite, [ww]) in
+ f (D.TBind (a, b, tt))
in
let f lenv = xlate_term f st lenv t in
in
let f lenv = xlate_term f st lenv t in
- push_abst f lenv a nw ww
in
xlate_term f st lenv w
| A.GRef (name, args) ->
in
xlate_term f st lenv w
| A.GRef (name, args) ->
| E.Name (id, _) -> f (A.GRef ((id, true, []), []))
| _ -> C.err ()
in
| E.Name (id, _) -> f (A.GRef ((id, true, []), []))
| _ -> C.err ()
in
- let map2 f t =
- let f _ tt = f tt in xlate_term f st lenv t
- in
- let g n qid (a, _, _) =
+ let map2 f t = xlate_term f st lenv t in
+ let g qid (a, _) =
let gref = D.TGRef ([], uri_of_qid qid) in
match args, a with
let gref = D.TGRef ([], uri_of_qid qid) in
match args, a with
- let f args = f n (D.TAppl ([], args, gref)) in
+ let f args = f (D.TAppl ([], args, gref)) in
let f args = C.list_rev_map f map2 args in
let f a = C.list_rev_map_append f map1 a ~tail:args in
C.list_sub_strict f a args
in
let g qid = resolve_gref_relaxed g st qid in
let err () = complete_qid g st name in
let f args = C.list_rev_map f map2 args in
let f a = C.list_rev_map_append f map1 a ~tail:args in
C.list_sub_strict f a args
in
let g qid = resolve_gref_relaxed g st qid in
let err () = complete_qid g st name in
- resolve_lref err (mk_lref f) (id_of_name name) lenv
+ D.resolve_lref err (mk_lref f) (id_of_name name) lenv
let xlate_entity err f st = function
| A.Section (Some (_, name)) ->
let xlate_entity err f st = function
| A.Section (Some (_, name)) ->
let f qid =
let f cnt =
let lenv = lenv_of_cnt cnt in
let f qid =
let f cnt =
let lenv = lenv_of_cnt cnt in
- let f nw ww =
- K.add hcnt (uri_of_qid qid) (add_abst cnt name ww nw);
+ let f ww =
+ K.add hcnt (uri_of_qid qid) (add_abst cnt name ww);
err {st with node = Some qid}
in
xlate_term f st lenv w
err {st with node = Some qid}
in
xlate_term f st lenv w
complete_qid f st (name, true, [])
| A.Decl (name, w) ->
let f cnt =
complete_qid f st (name, true, [])
| A.Decl (name, w) ->
let f cnt =
let lenv = lenv_of_cnt cnt in
let f qid =
let lenv = lenv_of_cnt cnt in
let f qid =
- let f nw ww =
- K.add henv (uri_of_qid qid) (N.succ nw, cnt);
+ let f ww =
+ K.add henv (uri_of_qid qid) cnt;
let t = match ws with
| [] -> ww
| _ -> D.TBind (a, D.Abst (N.infinite, ws), ww)
let t = match ws with
| [] -> ww
| _ -> D.TBind (a, D.Abst (N.infinite, ws), ww)
get_cnt_relaxed f st
| A.Def (name, w, trans, v) ->
let f cnt =
get_cnt_relaxed f st
| A.Def (name, w, trans, v) ->
let f cnt =
let lenv = lenv_of_cnt cnt in
let f qid =
let lenv = lenv_of_cnt cnt in
let f qid =
- let f nw ww =
- let f nv vv =
- assert (nv = N.succ nw); (**)
- K.add henv (uri_of_qid qid) (nv, cnt);
+ let f ww =
+ let f vv =
+ K.add henv (uri_of_qid qid) cnt;
let t = match ws with
| [] -> D.TCast ([], ww, vv)
| _ -> D.TBind (a, D.Abst (N.infinite, ws), D.TCast ([], ww, vv))
let t = match ws with
| [] -> D.TCast ([], ww, vv)
| _ -> D.TBind (a, D.Abst (N.infinite, ws), D.TCast ([], ww, vv))
| [] -> m, None, x
| (c, v) :: s ->
if N.is_zero n then Q.add_nonzero st.S.cc a;
| [] -> m, None, x
| (c, v) :: s ->
if N.is_zero n then Q.add_nonzero st.S.cc a;
- O.add ~beta:1 ~upsilon:(List.length s) ();
+ O.add ~beta:1 ~theta:(List.length s) ();
let e = B.push m.e c a (B.abbr v) (* (B.Cast ([], w, v)) *) in
step st {m with e = e; s = s} t
end
| B.Bind (a, b, t) ->
let e = B.push m.e c a (B.abbr v) (* (B.Cast ([], w, v)) *) in
step st {m with e = e; s = s} t
end
| B.Bind (a, b, t) ->
- O.add ~upsilon:(List.length m.s) ();
+ O.add ~theta:(List.length m.s) ();
let e = B.push m.e m.e a b in
step st {m with e = e} t
let e = B.push m.e m.e a b in
step st {m with e = e} t
\ / This software is distributed as is, NO WARRANTY.
V_______________________________________________________________ *)
\ / This software is distributed as is, NO WARRANTY.
V_______________________________________________________________ *)
let rec icm a = function
| B.Sort _
let rec icm a = function
| B.Sort _
let lift h d t =
if h = 0 then t else begin
let lift h d t =
if h = 0 then t else begin
-(* O.icm := succ (* icm *) !O.icm (*t*); *) iter (lift_map h) d t
+(*
+ G.icm := succ !G.icm;
+ G.icm := icm !G.icm t;
+*)
+ iter (lift_map h) d t
type reductions = {
beta : int;
zeta : int;
type reductions = {
beta : int;
zeta : int;
tau : int;
ldelta : int;
gdelta : int;
tau : int;
ldelta : int;
gdelta : int;
}
let initial_reductions = {
}
let initial_reductions = {
- beta = 0; upsilon = 0; tau = 0; zeta = 0; ldelta = 0; gdelta = 0;
+ beta = 0; theta = 0; tau = 0; zeta = 0; ldelta = 0; gdelta = 0;
si = 0; lrt = 0; grt = 0
}
si = 0; lrt = 0; grt = 0
}
let clear_reductions () = reductions := initial_reductions
let add
let clear_reductions () = reductions := initial_reductions
let add
- ?(beta=0) ?(upsilon=0) ?(tau=0) ?(ldelta=0) ?(gdelta=0) ?(zeta=0)
+ ?(beta=0) ?(theta=0) ?(tau=0) ?(ldelta=0) ?(gdelta=0) ?(zeta=0)
?(si=0) ?(lrt=0) ?(grt=0) ()
= reductions := {
beta = !reductions.beta + beta;
zeta = !reductions.zeta + zeta;
?(si=0) ?(lrt=0) ?(grt=0) ()
= reductions := {
beta = !reductions.beta + beta;
zeta = !reductions.zeta + zeta;
- upsilon = !reductions.upsilon + upsilon;
+ theta = !reductions.theta + theta;
tau = !reductions.tau + tau;
ldelta = !reductions.ldelta + ldelta;
gdelta = !reductions.gdelta + gdelta;
tau = !reductions.tau + tau;
ldelta = !reductions.ldelta + ldelta;
gdelta = !reductions.gdelta + gdelta;
let print_reductions () =
let r = !reductions in
let print_reductions () =
let r = !reductions in
- let rs = r.beta + r.ldelta + r.zeta + r.upsilon + r.tau + r.gdelta in
+ let rs = r.beta + r.ldelta + r.zeta + r.theta + r.tau + r.gdelta in
let prs = r.si + r.lrt + r.grt in
let delta = r.ldelta + r.gdelta in
let rt = r.lrt + r.grt in
let prs = r.si + r.lrt + r.grt in
let delta = r.ldelta + r.gdelta in
let rt = r.lrt + r.grt in
L.warn (P.sprintf " Delta: %7u" delta);
L.warn (P.sprintf " Local: %7u" r.ldelta);
L.warn (P.sprintf " Global: %7u" r.gdelta);
L.warn (P.sprintf " Delta: %7u" delta);
L.warn (P.sprintf " Local: %7u" r.ldelta);
L.warn (P.sprintf " Global: %7u" r.gdelta);
- L.warn (P.sprintf " Zeta: %7u" r.zeta);
- L.warn (P.sprintf " Upsilon: %7u" r.upsilon);
- L.warn (P.sprintf " Tau: %7u" r.tau);
+ L.warn (P.sprintf " Theta: %7u" r.theta);
+ L.warn (P.sprintf " Zeta for abbreviation: %7u" r.zeta);
+ L.warn (P.sprintf " Zeta for cast: %7u" r.tau);
L.warn (P.sprintf " Pseudo reductions: %7u" prs);
L.warn (P.sprintf " Reference typing: %7u" rt);
L.warn (P.sprintf " Local: %7u" r.lrt);
L.warn (P.sprintf " Pseudo reductions: %7u" prs);
L.warn (P.sprintf " Reference typing: %7u" rt);
L.warn (P.sprintf " Local: %7u" r.lrt);
val clear_reductions: unit -> unit
val add:
val clear_reductions: unit -> unit
val add:
- ?beta:int -> ?upsilon:int -> ?tau:int -> ?ldelta:int -> ?gdelta:int ->
+ ?beta:int -> ?theta:int -> ?tau:int -> ?ldelta:int -> ?gdelta:int ->
?zeta:int -> ?si:int -> ?lrt:int -> ?grt:int ->
unit -> unit
?zeta:int -> ?si:int -> ?lrt:int -> ?grt:int ->
unit -> unit
- let version_string = "Helena 0.8.1 M - November 2010" in
+ let version_string = "Helena 0.8.2 M - December 2010" in
let print_version () = L.warn (version_string ^ "\n"); exit 0 in
let set_hierarchy s =
if H.set_graph s then () else
let print_version () = L.warn (version_string ^ "\n"); exit 0 in
let set_hierarchy s =
if H.set_graph s then () else