Skip to content
Snippets Groups Projects
Commit 87516f84 authored by Patrick Baudin's avatar Patrick Baudin
Browse files

[qed] removing type 'a cache and related functions from the API

parent 68a58d78
No related branches found
No related tags found
No related merge requests found
...@@ -308,22 +308,13 @@ sig ...@@ -308,22 +308,13 @@ sig
val e_open : pool:pool -> ?forall:bool -> ?exists:bool -> ?lambda:bool -> val e_open : pool:pool -> ?forall:bool -> ?exists:bool -> ?lambda:bool ->
term -> (binder * var) list * term term -> (binder * var) list * term
(** Open all the specified binders (** Open all the specified binders (flags default to `true`, so all
consecutive top most binders are opened by default).
The pool must contain all free variables of the term. *) The pool must contain all free variables of the term. *)
val e_close : (binder * var) list -> term -> term val e_close : (binder * var) list -> term -> term
(** Closes all specified binders *) (** Closes all specified binders *)
(** {3 Local Caches} *)
type 'a cache
val cache : unit -> 'a cache
val get : 'a cache -> (term -> 'a) -> term -> 'a
val set : 'a cache -> term -> 'a -> unit
val lc_get : 'a cache -> (lc_term -> 'a) -> lc_term -> 'a
val lc_set : 'a cache -> lc_term -> 'a -> unit
val clear : 'a cache -> unit
(** {3 Generalized Substitutions} *) (** {3 Generalized Substitutions} *)
type sigma type sigma
...@@ -334,7 +325,6 @@ sig ...@@ -334,7 +325,6 @@ sig
type t = sigma type t = sigma
val create : ?pool:pool -> unit -> t val create : ?pool:pool -> unit -> t
val cache : sigma -> term cache
val fresh : t -> tau -> var val fresh : t -> tau -> var
val get : t -> term -> term val get : t -> term -> term
val filter : t -> term -> bool val filter : t -> term -> bool
......
...@@ -1955,17 +1955,12 @@ struct ...@@ -1955,17 +1955,12 @@ struct
(* --- Caches --- *) (* --- Caches --- *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
type 'a cache = 'a Tmap.t ref
let cache () = ref Tmap.empty let cache () = ref Tmap.empty
let get mu f e = let get mu f e =
try Tmap.find e !mu with Not_found -> try Tmap.find e !mu with Not_found ->
let v = f e in mu := Tmap.add e v !mu ; v let v = f e in mu := Tmap.add e v !mu ; v
let set mu e v = mu := Tmap.add e v !mu let set mu e v = mu := Tmap.add e v !mu
let clear mu = mu := Tmap.empty
let lc_set = set
let lc_get = get
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
(* --- Locally Nameless --- *) (* --- Locally Nameless --- *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment