Common — library colibrilib.env — module State

The generic environment: the model and the state are abstract, each theory gives its view of them in its own module

40
module State

One model of the input: the values of the nodes of every sort

42
type
model

The state of the propagation: the domains and the data of the theories

46
type
state

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.

51
type
ro
52
type
rw

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).

58
type
envp
'm = abstract mutable {
59
ghost
model
: model;
60
ghost mutable
alive
: bool;
61
ghost mutable
state
: state;
62
}
63
type
env
= envp rw

d is satisfied by its model (with the decisions of the current branch); the writes keep it, since their facts hold in the model

67
predicate
live
(d: envp 'm) = d.alive

Egraph.Contradiction: raised only when d is not live

70
exception
Contradiction

Egraph.contradiction

73
val
contradiction
(d: env) : unit
74
writes { d.state }
75
requires { not live d }
76
ensures { false }
77
end