module type Local =sig..end
Operations on the local state required for registering a new state via
State_builder.Register.
The local state is the mutable value which you would like to be
project-compliant.
type t
Type of the state to register.
val create : unit -> tHow to create a new fresh state which must be equal to the initial
state: that is, if you never change the state, create () and get must be equal (see invariant 1 below).
()
val clear : t -> unitHow to clear a state. After clearing, the state should be observationally the same that after its creation (see invariant 2 below).
val get : unit -> tHow to access to the current state. Be aware of invariants 3 and 4 below.
val set : t -> unitHow to change the current state. Be aware of invariants 3 and 4 below.
The four following invariants must hold.
create () returns a fresh value(p:t) copy p returns a fresh value(p:t), create () = (clear p; set p; get ())(p1:t),(p2:t) such that p1 != p2, (set p1; get ()) != s2val clear_some_projects : (Project_skeleton.t -> bool) -> t -> boolclear_if_project f x must clear any value v of type project of x
such that f v is true. Of course, if the type t does not contain
any object of type project, this function should do nothing and
safely returns fun _ -> false.
true iff at least one element of x has been cleared.