Module Logtk.DBEnv
De Bruijn environments
val empty : 'a tEmpty environment
val is_empty : 'a t -> boolAre there bindings?
val make : int -> 'a tEmpty environment of the given size
val singleton : 'a -> 'a tSingle binding
val push : 'a t -> 'a -> 'a tCreate a new environment, when entering a scope, where the De Bruijn index 0 is bound to the given value
val push_l_same_order : 'a t -> 'a list -> 'a tpush_l_same_order env lbuilds envl0 :: l1 :: … :: env
val push_none : 'a t -> 'a tCreate a new environment, when entering a scope, where the De Bruijn index 0 is bound to nothing.
val push_none_multiple : 'a t -> int -> 'a tCall
push_nonentimes (after we've enterednscopes, for instances)
val pop : 'a t -> 'a tExit a scope, removing the top binding.
- raises Invalid_argument
if the env is empty
val size : 'a t -> intNumber of scopes (number of times
pushorpush_nonewere called to produce the given environement)
val find : 'a t -> int -> 'a optionFind to which value the given De Bruijn index is bound to, or return None
val find_exn : 'a t -> int -> 'aUnsafe version of
find.- raises Failure
if the index is not bound within
env
val mem : _ t -> int -> boolmem env ireturnstrueifffind env ireturnsSome _rather thanNone, ie. whether thei-th De Bruijn variable is bound withinenv
val set : 'a t -> int -> 'a -> 'a tSet the
n-th variable to the given objects.- raises Invalid_argument
if the index isn't in the range
0... size-1
val num_bindings : _ t -> intHow many variables are actually bound?
val filteri : (int -> 'a -> bool) -> 'a t -> 'a tval of_list : (int * 'a) list -> 'a tMap indices to objects
val to_list : 'a t -> 'a option listList of underlying elements
val to_list_i : 'a t -> (int * 'a) option listList of underlying elements