module Bddint:Integer type for interpreted automatonsig
..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 Bddarith
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
t = {
|
signed : |
|
reg : |
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 : Manager.t -> int -> t -> t
val neg : t -> t
val succ : t -> t
val pred : t -> t
val add : t -> t -> t
val sub : t -> t -> t
val shift_left : int -> t -> t
val shift_right : int -> t -> t
val scale : int -> t -> t
val ite : Bdd.t -> t -> t -> t
val is_cst : t -> bool
val zero : Manager.t -> t -> Bdd.t
val equal : Manager.t -> t -> t -> Bdd.t
val greatereq : Manager.t -> t -> t -> Bdd.t
val greater : Manager.t -> t -> t -> Bdd.t
val of_int : Manager.t -> bool -> int -> int -> t
val to_int : t -> int
val equal_int : Manager.t -> t -> int -> Bdd.t
val greatereq_int : Manager.t -> t -> int -> Bdd.t
module Minterm:sig
..end
val guard_of_int : Manager.t -> t -> int -> Bdd.t
val guardints : Manager.t -> t -> (Bdd.t * int) list
g -> n
represented by the BDD register.val print : (int -> string) -> Format.formatter -> t -> unit
print f fmt t
prints the register t
using the formatter
fmt
and the function f
to convert BDDs indices to
names.val print_minterm : (Format.formatter -> Bdd.t -> unit) -> Format.formatter -> t -> unit
print_minterm f fmt t
prints the register t
using the formatter
fmt
and the function f
to convert BDDs indices to
names.