Module Relations.Additive
Simple additive relation: y = delta*x + b where delta is +/- 1 (indicated by a boolean with true -> positive)
- On
integeris is the usual unbounded addition - On
bitvectorit is modulo addition - On
booleanis is simply negation
type (_, _) t = private | Identity : ('a, 'a) t| Add_Modulo : {factor : delta;size : Units.In_bits.t;amount : Z.t;
} -> (Operator.Function_symbol.bitvector, Operator.Function_symbol.bitvector) t(*Invariant: is not identity either
*)factorisMinusOneoramountis non-zero (modulo 2^size)amountis in-2^(size-1) .. 2^(size-1)-1| Add_Unbounded : delta * Z.t -> (Operator.Function_symbol.integer, Operator.Function_symbol.integer) t(*Invariant: is not identity either the
*)deltaisMinusOne(negation) or the value is non-zero| Bool_Not : (Operator.Function_symbol.boolean, Operator.Function_symbol.boolean) t(*see
Additivefor description of this relationThe type is made private to ensure invariant are respected, use the constructors below to build terms
*)
val additive_identity : ('a, 'a) tval additive_bitvector :
size:Units.In_bits.t ->
delta ->
Z.t ->
(Operator.Function_symbol.bitvector, Operator.Function_symbol.bitvector) tval additive_integer :
delta ->
Z.t ->
(Operator.Function_symbol.integer, Operator.Function_symbol.integer) tval boolean_not :
(Operator.Function_symbol.boolean, Operator.Function_symbol.boolean) tinclude Union_Find.Parameters.GENERIC_GROUP with type ('a, 'b) t := ('a, 'b) t
include Union_Find.Parameters.GENERIC_MONOID with type ('a, 'b) t := ('a, 'b) t
val pretty : Stdlib.Format.formatter -> ('a, 'b) t -> unitPretty printer for relations
val pretty_with_terms :
(Stdlib.Format.formatter -> 'tl -> unit) ->
'tl ->
(Stdlib.Format.formatter -> 'tr -> unit) ->
'tr ->
Stdlib.Format.formatter ->
('a, 'b) t ->
unitpretty_with_terms pp_x x pp_y y rel pretty-prints the relation rel between terms x and y (respectively printed with pp_x and pp_y).
For placeholder variables, use pretty
val identity : ('a, 'a) tThe identity relation
Monoid composition, written using the functional convention compose f g is f \circ g. Should be associative, and compatible with identity:
- For all x,
G.compose x G.identity = G.compose G.identity x = x - For all x y z,
G.compose x (G.compose y z) = G.compose (G.compose x y) z
module Action
(B : Single_value_abstraction.Sig.NUMERIC_ENUM) :
GROUP_ACTION
with type bitvector = B.bitvector
and type integer = B.integer
and type boolean = B.boolean
and type enum = B.enum
and type ('a, 'b) relation = ('a, 'b) t