Module Stack.M

Stack is represented as a mapping from relevant terms to locations.

type t
include Datatype_sig.PRINTABLE with type t := t
include Datatype_sig.SHOW with type t := t
val pp : Stdlib.Format.formatter -> t -> unit

Output to formatter

val print : ?prefix:string -> t -> unit

Output to stdout.

val show_option : t option -> string
val print_option : ?prefix:string -> t option -> unit
val dump : string -> t -> unit

Dump to file given by filename

Lists of printable values

val show_list : ?separator:string -> t list -> string
val pp_list : Stdlib.Format.formatter -> t list -> unit
val print_list : ?separator:string -> ?prefix:string -> t list -> unit

Copy-pasted signature of classic polymorphic map

val empty : t
val is_empty : t -> bool
val add : SL.Term.t -> Location.t -> t -> t
val mem : SL.Term.t -> t -> bool
val find : SL.Term.t -> t -> Location.t
val iter : (SL.Term.t -> Location.t -> unit) -> t -> unit
val fold : (SL.Term.t -> Location.t -> 'acc -> 'acc) -> t -> 'acc -> 'acc
val union : (SL.Term.t -> Location.t -> Location.t -> Location.t option) -> t -> t -> t
val bindings : t -> (SL.Term.t * Location.t) list
val cardinal : t -> int
val choose : t -> SL.Term.t * Location.t
val filter : (SL.Term.t -> Location.t -> bool) -> t -> t

Additional functions

val keys : t -> SL.Term.t list
val values : t -> Location.t list
val of_list : (SL.Term.t * Location.t) list -> t
val find_pred : (SL.Term.t -> bool) -> t -> SL.Term.t
val show : t -> string
val show_custom : (SL.Term.t -> string) -> (Location.t -> string) -> t -> string