module Reg:sig
..end
The type handled by the module is an array of BDDs, which represent a processor-like register with the Least Significant Bit in first position.
This module requires the mlcuddidl library.
type'a
t ='a Cudd.Bdd.t array
typedt =
Cudd.Man.d t
typevt =
Cudd.Man.v t
val lnot : 'a t -> 'a t
Logical negation (for all bits).
val shift_left : 'a Cudd.Man.t -> int -> 'a t -> 'a t * 'a Cudd.Bdd.t
shift_left man t n
shifts the register to the left by n
bits. Returns the resulting register and the carry, which
contains the last bit shifted out of the register. Assume, as
for the following functions, that n
is between 1
and
the size of the register.val shift_right : 'a Cudd.Man.t -> int -> 'a t -> 'a t * 'a Cudd.Bdd.t
shift_right t n
shifts the register to the right by n
bits. This an arithmetical shift: the sign is inserted
as the new most significant bits. Returns the resulting
register and the carry, which contains the last bit shifted
out of the register.val shift_right_logical : 'a Cudd.Man.t -> int -> 'a t -> 'a t * 'a Cudd.Bdd.t
shift_right
, but here logical shift: a zero
is always inserted.val extend : 'a Cudd.Man.t -> signed:bool -> int -> 'a t -> 'a t
extend ~signed:b n x
extends the register x by adding n
most
significant bits, if n>0
, or truncate the -n
most significant bits if
n<0
. b
indicates whether the register is considered as a signed one or
not.val succ : 'a Cudd.Man.t -> 'a t -> 'a t * 'a Cudd.Bdd.t
val pred : 'a Cudd.Man.t -> 'a t -> 'a t * 'a Cudd.Bdd.t
val add : 'a Cudd.Man.t ->
'a t -> 'a t -> 'a t * 'a Cudd.Bdd.t * 'a Cudd.Bdd.t
val sub : 'a Cudd.Man.t ->
'a t -> 'a t -> 'a t * 'a Cudd.Bdd.t * 'a Cudd.Bdd.t
val neg : 'a t -> 'a t
n
,
the negation of -2^(n-1)
is itself.val scale : int -> 'a t -> 'a t
val mul : 'a t -> 'a t -> 'a t
val ite : 'a Cudd.Bdd.t -> 'a t -> 'a t -> 'a t
val is_cst : 'a t -> bool
val zero : 'a Cudd.Man.t -> 'a t -> 'a Cudd.Bdd.t
val equal : 'a Cudd.Man.t -> 'a t -> 'a t -> 'a Cudd.Bdd.t
val greatereq : 'a Cudd.Man.t -> 'a t -> 'a t -> 'a Cudd.Bdd.t
val greater : 'a Cudd.Man.t -> 'a t -> 'a t -> 'a Cudd.Bdd.t
val highereq : 'a Cudd.Man.t -> 'a t -> 'a t -> 'a Cudd.Bdd.t
val higher : 'a Cudd.Man.t -> 'a t -> 'a t -> 'a Cudd.Bdd.t
val min_size : int -> int
min_size cst
computes the minimum number of bits required
to represent the given constant. We have for example min_size
0=0
, min_size 1 = 1
, min_size 3 = 2
, min_size (-8) = 4
.val of_int : 'a Cudd.Man.t -> int -> int -> 'a t
of_int size cst
puts the constant integer cst
in a constant register
of size size
. The fact that size
is big enough is checked using the
previous function, and a Failure "..."
exception is raised in case of
problem.val to_int : signed:bool -> 'a t -> int
to_int sign x
converts a constant register to an integer. sign
indicates whether the register is to be interpreted as a signed or
unsigned.val equal_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.t
val greatereq_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.t
val greater_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.t
val highereq_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.t
val higher_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.t
module Minterm:sig
..end
val guard_of_minterm : 'a Cudd.Man.t -> 'a t -> Minterm.t -> 'a Cudd.Bdd.t
val guard_of_int : 'a Cudd.Man.t -> 'a t -> int -> 'a Cudd.Bdd.t
val guardints : 'a Cudd.Man.t -> signed:bool -> 'a t -> ('a Cudd.Bdd.t * int) list
g -> n
represented by the BDD register.val cofactor : 'a t -> 'a Cudd.Bdd.t -> 'a t
val restrict : 'a t -> 'a Cudd.Bdd.t -> 'a t
val tdrestrict : 'a t -> 'a Cudd.Bdd.t -> 'a t
val print : (Format.formatter -> int -> unit) -> Format.formatter -> 'a t -> unit
print f fmt t
prints the register t
using the formatter
fmt
and the function f
to print BDDs indices.val print_minterm : signed:bool ->
(Format.formatter -> 'a Cudd.Bdd.t -> unit) ->
Format.formatter -> 'a 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.val permute : ?memo:Cudd.Memo.t -> 'a t -> int array -> 'a t
Cudd.Bdd.permute
and Cudd.Bdd.permute_memo
)val varmap : 'a t -> 'a t
Cudd.Bdd.varmap
)val vectorcompose : ?memo:Cudd.Memo.t -> 'a Cudd.Bdd.t array -> 'a t -> 'a t
Cudd.Bdd.vectorcompose
and
Cudd.Bdd.vectorcompose_memo
)