module Int:sig..end
Bddarith, which provides with arrays resizing and signs.
Let us give an example: suppose we have a variable i: int[0..7]; this
variable will be encoded by 3 Boolean variables i0,i1,i2, starting from the
least significant bit. Now, how to translate the expression i<=5 ? Here the
result will be i2 and not i1 or not i2
This module requires the mlcuddidl library and the Bddreg module.
The basic types are signed or unsigned
n-bits integers. Integers are defined by a an array of BDDs,
each BDD corresponding to a bit. The order in this array is
going from the LSB (Least Significant Bit) to the
MSB (Most Significant Bit).
type 'a t = {
|
signed : |
|
reg : |
typedt =Cudd.Man.d t
typevt =Cudd.Man.v t
exception Typing of string
Bddarith. Resizing and conversion from unsigned to signed are automatic.
For instance, When adding or substracting integers, the smallest one is
resized to the size of the larger one, possibly with one more bit if they are
not of the same type (signed or unsigned).val extend : 'a Cudd.Man.t -> int -> 'a t -> 'a tval neg : 'a t -> 'a tval succ : 'a t -> 'a tval pred : 'a t -> 'a tval add : 'a t -> 'a t -> 'a tval sub : 'a t -> 'a t -> 'a tval mul : 'a t -> 'a t -> 'a tval shift_left : int -> 'a t -> 'a tval shift_right : int -> 'a t -> 'a tval scale : int -> 'a t -> 'a tval ite : 'a Cudd.Bdd.t -> 'a t -> 'a t -> 'a tval is_cst : 'a t -> boolval zero : 'a Cudd.Man.t -> 'a t -> 'a Cudd.Bdd.tval equal : 'a Cudd.Man.t -> 'a t -> 'a t -> 'a Cudd.Bdd.tval greatereq : 'a Cudd.Man.t -> 'a t -> 'a t -> 'a Cudd.Bdd.tval greater : 'a Cudd.Man.t -> 'a t -> 'a t -> 'a Cudd.Bdd.tval of_int : 'a Cudd.Man.t -> bool -> int -> int -> 'a tval to_int : 'a t -> intval equal_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.tval greatereq_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.tval greater_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.tmodule Minterm:sig..end
val guard_of_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.tval guardints : 'a Cudd.Man.t -> 'a t -> ('a Cudd.Bdd.t * int) listg -> n represented by the BDD register.val cofactor : 'a t -> 'a Cudd.Bdd.t -> 'a tval restrict : 'a t -> 'a Cudd.Bdd.t -> 'a tval tdrestrict : 'a t -> 'a Cudd.Bdd.t -> 'a tval print : (Format.formatter -> int -> unit) -> Format.formatter -> 'a t -> unitprint f fmt t prints the register t using the formatter
fmt and the function f to print BDDs indices.val print_minterm : (Format.formatter -> 'a Cudd.Bdd.t -> unit) ->
Format.formatter -> 'a t -> unitprint_minterm f fmt t prints the register t using the formatter
fmt and the function f to convert BDDs indices to
names.val permute : ?memo:Cudd.Memo.t -> 'a t -> int array -> 'a tCudd.Bdd.permute and Cudd.Bdd.permute_memo)val varmap : 'a t -> 'a tCudd.Bdd.varmap)val vectorcompose : ?memo:Cudd.Memo.t -> 'a Cudd.Bdd.t array -> 'a t -> 'a tCudd.Bdd.vectorcompose and
Cudd.Bdd.vectorcompose_memo)