module type INPUT = sig
.. end
Main input signature of Project.Computation.Register
.
type
t
Type of the state to register.
val create : unit -> t
How 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 -> unit
How to clear a state. After cleaning, the state should be
observationaly the same that after its creation (see invariant 2
below).
Consult the Plugin Development Guide for additional details.
val get : unit -> t
How to access to the current state. Be aware of invariants 3 and 4
below.
val set : t -> unit
How to change the current state. Be aware of invariants 3 and 4
below.
The four following invariants must hold.
create ()
returns a fresh value
- forall
(p:t)
copy p
returns a fresh value
- forall
(p:t)
, create () = (clear p; set p; get ())
- forall
(p1:t),(p2:t)
such that p1 != p2
, (set p1; get ()) != s2
val clear_if_project : Project.project -> t -> bool
clear_if_project p x
must clear any element of x
equals to the
project p
. Of course, if the type t
does not contain any object
of type project
, this function may be safely equal to fun _ _ ->
false
.
Returns true iff at least one element of x
has been cleared.