From c27ee110a8369cfdd001abfb08dede75e5319848 Mon Sep 17 00:00:00 2001 From: Andrei Paskevich Date: Thu, 2 Dec 2010 13:50:01 +0100 Subject: [PATCH] minor --- src/core/term.ml | 45 ++++++++++++++++++++++----------------------- src/core/term.mli | 5 ++++- src/core/ty.mli | 2 +- src/util/plugin.mli | 1 - 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/core/term.ml b/src/core/term.ml index cd0b0c294..187e1c8ce 100644 --- a/src/core/term.ml +++ b/src/core/term.ml @@ -1896,33 +1896,32 @@ let f_map_simp fnT fnF f = f_label_copy f (match f.f_node with let f_map_simp fnT = f_map_simp (protect fnT) -(** Proposition of another fold *) -(* Type in terms and formulae *) -let rec t_fold_ty fty s t = - let s = t_fold_unsafe (t_fold_ty fty) (f_fold_ty fty) s t in - let s = fty s t.t_ty in +(* Fold over types in terms and formulas *) + +let rec t_fold_ty fty acc t = + let acc = t_fold_unsafe (t_fold_ty fty) (f_fold_ty fty) acc t in + let acc = fty acc t.t_ty in match t.t_node with - | Teps fb -> - let vs,_,_ = fb in - fty s vs.vs_ty - | _ -> s + | Teps (vs,_,_) -> fty acc vs.vs_ty + | _ -> acc -and f_fold_ty fty s f = - let s = f_fold_unsafe (t_fold_ty fty) (f_fold_ty fty) s f in +and f_fold_ty fty acc f = + let acc = f_fold_unsafe (t_fold_ty fty) (f_fold_ty fty) acc f in match f.f_node with - | Fquant (_,fq) -> - let (vsl,_,_,_) = fq in - List.fold_left (fun s vs -> fty s vs.vs_ty) s vsl - | _ -> s + | Fquant (_,(vsl,_,_,_)) -> + List.fold_left (fun acc vs -> fty acc vs.vs_ty) acc vsl + | _ -> acc + +(* Fold over EXACTLY WHAT? in terms and formulas *) -let rec t_fold_sig fty s t = - let s = t_fold_unsafe (t_fold_sig fty) (f_fold_sig fty) s t in +let rec t_fold_sig fty acc t = + let acc = t_fold_unsafe (t_fold_sig fty) (f_fold_sig fty) acc t in match t.t_node with - | Tapp (fs,tl) -> fty s fs (List.map (fun t -> t.t_ty) tl) - | _ -> s + | Tapp (fs,tl) -> fty acc fs (List.map (fun t -> t.t_ty) tl) + | _ -> acc -and f_fold_sig fty s f = - let s = f_fold_unsafe (t_fold_sig fty) (f_fold_sig fty) s f in +and f_fold_sig fty acc f = + let acc = f_fold_unsafe (t_fold_sig fty) (f_fold_sig fty) acc f in match f.f_node with - | Fapp (fs,tl) -> fty s fs (List.map (fun t -> t.t_ty) tl) - | _ -> s + | Fapp (fs,tl) -> fty acc fs (List.map (fun t -> t.t_ty) tl) + | _ -> acc diff --git a/src/core/term.mli b/src/core/term.mli index e070659bc..1c903b69d 100644 --- a/src/core/term.mli +++ b/src/core/term.mli @@ -424,6 +424,7 @@ val list_map_cont : (('a -> 'b) -> 'c -> 'b) -> ('a list -> 'b) -> 'c list -> 'b (** simplification map *) + val f_map_simp : (term -> term) -> (fmla -> fmla) -> fmla -> fmla (** map/fold over free variables *) @@ -472,6 +473,7 @@ val f_ty_freevars : Stv.t -> fmla -> Stv.t val t_equal_alpha : term -> term -> bool val f_equal_alpha : fmla -> fmla -> bool + module Hterm_alpha : Hashtbl.S with type key = term module Hfmla_alpha : Hashtbl.S with type key = fmla @@ -506,7 +508,8 @@ exception NoMatch val t_match : term Mvs.t -> term -> term -> term Mvs.t val f_match : term Mvs.t -> fmla -> fmla -> term Mvs.t -(** Proposition of another fold *) +(** fold over types in terms and formulas *) + val t_fold_ty : ('a -> ty -> 'a) -> 'a -> term -> 'a val f_fold_ty : ('a -> ty -> 'a) -> 'a -> fmla -> 'a diff --git a/src/core/ty.mli b/src/core/ty.mli index e14560961..8088b6c68 100644 --- a/src/core/ty.mli +++ b/src/core/ty.mli @@ -87,7 +87,7 @@ val ty_all : (ty -> bool) -> ty -> bool val ty_any : (ty -> bool) -> ty -> bool (** {3 symbol-wise map/fold} *) -(** visites every symbol of the type} *) +(** visits every symbol of the type} *) val ty_s_map : (tysymbol -> tysymbol) -> ty -> ty val ty_s_fold : ('a -> tysymbol -> 'a) -> 'a -> ty -> 'a val ty_s_all : (tysymbol -> bool) -> ty -> bool diff --git a/src/util/plugin.mli b/src/util/plugin.mli index f03e4efe3..2af55c9a8 100644 --- a/src/util/plugin.mli +++ b/src/util/plugin.mli @@ -13,7 +13,6 @@ val load : ?dirs:string list -> plugin -> unit plugin named [plugin]. It add the extension .cmo or .cmxs to the filename according to the compilation used for the main program *) - type plu = (* not a plugin extension *) | Plubad -- GitLab