library colibrilib.env — module StateThe generic environment: the model and the state are abstract, each theory gives its view of them in its own module
module State40
One model of the input: the values of the nodes of every sort
type model42
The state of the propagation: the domains and the data of the theories
type state46
The access to the e–graph, as in OCaml (Egraph.t): envp ro only reads it (the events), env = envp rw also writes it (the daemons). Only the functions that write take env.
type ro51type rw52
The e–graph, with its model. Its state is hidden and mutable: the writes (writes { d.state }) have an effect, so that the extraction keeps their calls (a call without effect that returns unit is removed).
type envp 'm = abstract mutable {58ghost model : model;59ghost mutable alive : bool;60ghost mutable state : state;61}62type env = envp rw63
d is satisfied by its model (with the decisions of the current branch); the writes keep it, since their facts hold in the model
predicate live (d: envp 'm) = d.alive67
Egraph.Contradiction: raised only when d is not live
exception Contradiction70
Egraph.contradiction
val contradiction (d: env) : unit73writes { d.state }74requires { not live d }75ensures { false }76end77