Module StarvationDomain.Order

Represents the existence of a program path to the first lock being taken in the current method or, transitively, a callee *in the same class*, and, which continues (to potentially another class) until the eventually event, schematically -->first-->eventually. It is guaranteed that during the second part of the trace (first-->eventually) the lock first is not released.

type order_t = private {
first : Lock.t;
eventually : Event.t;
}
include ExplicitTrace.TraceElem with type elem_t = order_t
type elem_t = order_t
type t = private {
elem : elem_t;
loc : InferBase.Location.t;
trace : InferIR.CallSite.t list;
}

An elem which occured at loc, after the chain of steps (usually calls) in trace.

Both pp and pp_human simply call the same function on the trace element.

include ExplicitTrace.Element with type Element.t := t
include InferStdlib.PrettyPrintable.PrintableOrderedType
include InferStdlib.IStd.Caml.Set.OrderedType
type t
val compare : t -> t -> int
include InferStdlib.PrettyPrintable.PrintableType with type t := t
type t
val pp : InferStdlib.PrettyPrintable.F.formatter -> t -> unit
val pp_human : Stdlib.Format.formatter -> t -> unit

Pretty printer used for trace construction; pp is used for debug output.

val pp_call : Stdlib.Format.formatter -> InferIR.CallSite.t -> unit
val make : elem_t -> InferBase.Location.t -> t
val map : f:(elem_t -> elem_t) -> t -> t
val get_loc : t -> InferBase.Location.t

Starting location of the trace: this is either loc if trace==[], or the head of trace.

val make_loc_trace : ?⁠nesting:int -> t -> InferIR.Errlog.loc_trace
val with_callsite : t -> InferIR.CallSite.t -> t

Push given callsite onto trace, extending the call chain by one.

module FiniteSet : ExplicitTrace.FiniteSet with type FiniteSet.elt = t

A powerset of traces.

val may_deadlock : t -> t -> bool

check if two pairs are symmetric in terms of locks, where locks are compared modulo the variable name at the root of each path.

val make_trace : ?⁠header:string -> InferIR.Typ.Procname.t -> t -> InferIR.Errlog.loc_trace