Common — library colibrilib.env — module Env

The environment of LRA: the e–graph and the real values

91
module Env
92
use real.RealInfix
93
use option.Option
94
use colibrilib.ring.Atom
95
use colibrilib.stda.StdA as A
96
use export State
97
use export RealValue

The value of the real nodes of d

100
function
m
(d: envp 'm) : Atom.t -> real = real_value d.model

Egraph.find_def: the representative

103
val
find_def
(d: envp 'm) (n:Atom.t) : Atom.t
104
ensures { live d -> d.m result = d.m n }

Egraph.is_equal

107
val
is_equal
(d: envp 'm) (a b:Atom.t) : bool
108
ensures { result -> live d -> d.m a = d.m b }

Egraph.merge

111
val
merge
(d: env) (a b:Atom.t) : unit
112
requires { live d -> d.m a = d.m b }
113
writes { d.state }

RealValue.get: the value of the node, if known

116
val
value
(d: envp 'm) (n:Atom.t) : option A.t
117
ensures { match result with
118
| Some c -> live d -> d.m n = A.real c
119
| None -> true
120
end }

The registered node of the value c (RealValue.node and Egraph.register)

124
val
cst_node
(d: env) (c:A.t) : Atom.t
125
writes { d.state }
126
ensures { live d -> d.m result = A.real c }
127
end