Common — library colibrilib.ring — module Atom

The atoms: an abstract type with a strict total order (trusted: the comparison of the nodes of colibri2)

10
module Atom
11
use int.Int
12
use mach.int.Int63
13
14
type
t
15
16
predicate
lt
t t
17
18
axiom
lt_irrefl
: forall a. not (lt a a)
19
axiom
lt_trans
: forall a b c. lt a b -> lt b c -> lt a c
20
axiom
lt_total
: forall a b. lt a b \/ a = b \/ lt b a
21
22
val
compare
(a b:t) : int63
23
ensures { result < 0 <-> lt a b }
24
ensures { result = 0 <-> a = b }
25
ensures { result > 0 <-> lt b a }
26
27
val
equal
(a b:t) : bool
28
ensures { result <-> a = b }
29
end