Primus.MachinePrimus Machine.
The Machine is the core of Primus Framework. The Machine behavior is extended/changed with Machine components.
The user analysis is usually written in a form of a component, and is registered with the Primus.Components.register function.
type id = Monads.Std.Monad.State.Multi.idMachine identifier type.
val init : unit observationA synonym to System.init
val finished : unit observationA synonym to System.fini
val fork : (id * id) observationfork (parent,child) occurs when the machine parent forks a new clone child. The computation continues in the child machine.
val switch : (id * id) observationswitch (was,now) occurs when computation switches from the machine was to the machine now.
val exn_raised : exn observationexn_raised exn occurs every time an abnormal control flow is initiated
val kill : id observationkill id occurs when the machine id is killed.
When this observation is made the machine enters the restricted mode with non-determinism and observations disabled.
module State : sig ... endMachine State.
type 'a state = 'a State.tmodule type State = sig ... endAn interface to the state.
module type S = sig ... endThe Machine interface.
type component = (module Component)The Machine component.
Make(Monad) a monad transformer that wraps the Machine into an arbitrary Monad.
val add_component : component -> unitadd_component comp registers the machine component comp in the Primus Framework. The component's init function will be run every time the Machine compuation is run. After all components are initialized, the init observation is made.
The components shall not access the interpreter in their init function. Instead, they should subscribe to observations and/or initialize the machine state via Linker/Memory/Env components.
See also a more general register_component function.