Module State_selection

module State_selection: sig .. end

A state selection is a set of states with operations for easy handling of state dependencies.


Type declarations

type t 

Type of a state selection.

val ty : t Type.t

Type value representing State_selection.t.

Generic Builders

val empty : t

The empty selection.

val full : t

The selection containing all the states.

val singleton : State.t -> t

The selection containing only the given state.

val of_list : State.t list -> t

The selection containing only the given list of states.

Generic Getters

val is_empty : t -> bool
val is_full : t -> bool
val mem : t -> State.t -> bool

Specific selections

Builders from dependencies

val with_dependencies : State.t -> t

The selection containing the given state and all its dependencies.

val only_dependencies : State.t -> t

The selection containing all the dependencies of the given state (but not this state itself).

val with_codependencies : State.t -> t

The selection containing the given state and all its co-dependencies.

val only_codependencies : State.t -> t

The selection containing all the co-dependencies of the given state (but not this state itself).

Builders by operations over sets

val union : t -> t -> t

Union of two selections.

val list_union : t list -> t

Union of an arbitrary number of selection (0 gives an empty selection)

val diff : t -> t -> t

Difference between two selections.

Specific Getters

val cardinal : t -> int

Size of a selection.

val to_list : t -> State.t list

Convert a selection into a list of states.

val pretty : Stdlib.Format.formatter -> t -> unit

Display a selection.

val pretty_witness : Stdlib.Format.formatter -> t -> unit

Display a selection in a more concise form. (Using the atomic operations that were used to create it.)

Iterators

val iter_succ : (State.t -> unit) -> t -> State.t -> unit

Iterate over the successor of a state in a selection. The order is unspecified.

val fold_succ : (State.t -> 'a -> 'a) -> t -> State.t -> 'a -> 'a

Iterate over the successor of a state in a selection. The order is unspecified.

val iter : (State.t -> unit) -> t -> unit

Iterate over a selection. The order is unspecified.

val fold : (State.t -> 'a -> 'a) -> t -> 'a -> 'a

Fold over a selection. The order is unspecified.

val iter_in_order : (State.t -> unit) -> t -> unit

Iterate over a selection in a topological ordering compliant with the State Dependency Graph. Less efficient that State_selection.iter.

val fold_in_order : (State.t -> 'a -> 'a) -> t -> 'a -> 'a

Fold over a selection in a topological ordering compliant with the State Dependency Graph. Less efficient that State_selection.iter.