BddEncCache_ptr BddEncCache_create( BddEnc_ptr enc )
BddEncCache.c
void BddEncCache_destroy( BddEncCache_ptr self )
BddEncCache.c
add_ptr BddEncCache_get_definition( BddEncCache_ptr self, node_ptr name )
BddEncCache.c
add_ptr BddEncCache_get_evaluation( BddEncCache_ptr self, node_ptr name )
BddEncCache.c
boolean BddEncCache_is_constant_defined( BddEncCache_ptr self, node_ptr constant )
BddEncCache.c
boolean BddEncCache_is_var_defined( BddEncCache_ptr self, node_ptr var_name )
BddEncCache.c
add_ptr BddEncCache_lookup_constant( BddEncCache_ptr self, node_ptr constant )
BddEncCache.c
add_ptr BddEncCache_lookup_var( BddEncCache_ptr self, node_ptr var_name )
BddEncCache.c
void BddEncCache_new_constant( BddEncCache_ptr self, node_ptr constant, add_ptr constant_add )
BddEncCache.c
void BddEncCache_new_var( BddEncCache_ptr self, node_ptr var_name, add_ptr var_add )
BddEncCache.c
void BddEncCache_pop_status( BddEncCache_ptr self )
BddEncCache.c
void BddEncCache_push_status_and_reset( BddEncCache_ptr self )
BddEncCache.c
void BddEncCache_set_definition( BddEncCache_ptr self, node_ptr name, add_ptr def )
BddEncCache.c
void BddEncCache_set_evaluation( BddEncCache_ptr self, node_ptr name, add_ptr add )
BddEncCache.c
add_ptr BddEnc_apply_input_vars_mask_add( BddEnc_ptr self, add_ptr inputs )
BddEnc.c
BddInputs BddEnc_apply_input_vars_mask_bdd( BddEnc_ptr self, BddInputs inputs )
BddEnc.c
add_ptr BddEnc_apply_state_input_vars_mask_add( BddEnc_ptr self, add_ptr states_inputs )
BddEnc.c
BddStatesInputs BddEnc_apply_state_input_vars_mask_bdd( BddEnc_ptr self, BddStatesInputs states_inputs )
BddEnc.c
add_ptr BddEnc_apply_state_vars_mask_add( BddEnc_ptr self, add_ptr states )
BddEnc.c
BddStates BddEnc_apply_state_vars_mask_bdd( BddEnc_ptr self, BddStates states )
BddEnc.c
add_ptr BddEnc_constant_to_add( const BddEnc_ptr self, node_ptr constant )
VAR state : {idle, stopped}then in the constant hash for the atom idle there is the corresponding leaf ADD, i.e. the ADD whose value is the symbol idle.
BddEnc.c
double BddEnc_count_inputs_of_bdd( const BddEnc_ptr self, bdd_ptr bdd )
BddEnc.c
double BddEnc_count_states_inputs_of_bdd( const BddEnc_ptr self, bdd_ptr bdd )
BddEnc.c
double BddEnc_count_states_of_add( const BddEnc_ptr self, add_ptr add )
BddEnc.c
double BddEnc_count_states_of_bdd( const BddEnc_ptr self, bdd_ptr bdd )
BddEnc.c
BddEnc_ptr BddEnc_create( Encoding_ptr generic_encoding, DdManager* dd )
BddEnc.c
void BddEnc_destroy( BddEnc_ptr self )
BddEnc.c
add_ptr BddEnc_eval_constant( BddEnc_ptr self, Expr_ptr expr, node_ptr context )
eval
eval_num
BddEnc.c
int BddEnc_eval_num( BddEnc_ptr self, node_ptr e, node_ptr context )
e
in
context context
. NUMBERS can be encoded in
different ways in different processes.
bdd_enc_eval
BddEnc.c
add_ptr BddEnc_eval_sign_add( BddEnc_ptr self, add_ptr a, int flag )
a
, this function returns
the negation of ADD a
or a
itself according the
value of flag
. If flag = -1
then returns not
a
, else returns a
. It is important that the ADD is a
zero/one ADD (i.e. it has only zero or one as leaf).
bdd_enc_eval
BddEnc.c
bdd_ptr BddEnc_eval_sign_bdd( BddEnc_ptr self, bdd_ptr a, int flag )
a
, this function returns
the negation of BDD a
or a
itself according the
value of flag
. If flag = -1
then returns not
a
, else returns a
. It is important that the BDD is a
zero/one BDD (i.e. it has only zero or one as leaf).
BddEnc.c
add_ptr BddEnc_expr_to_add( BddEnc_ptr self, const Expr_ptr expr, const node_ptr context )
BddEnc.c
bdd_ptr BddEnc_expr_to_bdd( BddEnc_ptr self, const Expr_ptr expr, const node_ptr context )
BddEnc.c
DdManager* BddEnc_get_dd_manager( const BddEnc_ptr self )
BddEnc.c
add_ptr BddEnc_get_input_vars_mask_add( BddEnc_ptr self )
BddEnc.c
bdd_ptr BddEnc_get_input_vars_mask_bdd( BddEnc_ptr self )
BddEnc.c
BddVarSet_ptr BddEnc_get_input_vars_support( const BddEnc_ptr self )
BddEnc.c
double BddEnc_get_minterms_of_add( const BddEnc_ptr self, add_ptr add )
BddEnc.c
double BddEnc_get_minterms_of_bdd( const BddEnc_ptr self, bdd_ptr bdd )
BddEnc.c
BddVarSet_ptr BddEnc_get_next_state_vars_support( const BddEnc_ptr self )
BddEnc.c
NodeList_ptr BddEnc_get_ordering( const BddEnc_ptr self )
BddEnc.c
add_ptr BddEnc_get_state_input_vars_mask_add( BddEnc_ptr self )
BddEnc.c
bdd_ptr BddEnc_get_state_input_vars_mask_bdd( BddEnc_ptr self )
BddEnc.c
node_ptr BddEnc_get_state_vars_add_list( BddEnc_ptr self )
BddEnc.c
add_ptr BddEnc_get_state_vars_mask_add( BddEnc_ptr self )
BddEnc.c
bdd_ptr BddEnc_get_state_vars_mask_bdd( BddEnc_ptr self )
BddEnc.c
BddVarSet_ptr BddEnc_get_state_vars_support( const BddEnc_ptr self )
BddEnc.c
add_ptr BddEnc_get_symbol_add( BddEnc_ptr self, node_ptr name )
n
, this
function returns the ADD of its definition, or NULL if not defined.
Errors occurs if circularly defined. Returned add is referenced
BddEnc_expr_to_add
BddEnc.c
Encoding_ptr BddEnc_get_symbolic_encoding( const BddEnc_ptr self )
BddEnc.c
add_ptr BddEnc_get_var_encoding_mask( BddEnc_ptr self, add_ptr var_encoding )
BddEnc_get_var_name_mask
bdd_enc_get_var_mask_add_recur
BddEnc.c
int BddEnc_get_var_index_from_name( const BddEnc_ptr self, node_ptr name )
optional
BddEnc.c
node_ptr BddEnc_get_var_name_from_dd_index( const BddEnc_ptr self, int index )
optional
BddEnc.c
add_ptr BddEnc_get_var_name_mask( BddEnc_ptr self, node_ptr var_name )
BddEnc_get_var_encoding_mask
bdd_enc_get_var_mask_add_recur
BddEnc.c
void BddEnc_merge( BddEnc_ptr self )
BddEnc.c
add_ptr BddEnc_next_state_var_to_state_var_add( const BddEnc_ptr self, add_ptr add )
BddEnc.c
bdd_ptr BddEnc_next_state_var_to_state_var( const BddEnc_ptr self, bdd_ptr bdd )
BddEnc.c
boolean BddEnc_pick_all_terms_inputs( const BddEnc_ptr self, bdd_ptr bdd, bdd_ptr* result_array, const int array_len )
bdd_pick_all_terms
BddEnc.c
boolean BddEnc_pick_all_terms_states_inputs( const BddEnc_ptr self, bdd_ptr bdd, bdd_ptr* result_array, const int array_len )
bdd_pick_all_terms
BddEnc.c
boolean BddEnc_pick_all_terms_states( const BddEnc_ptr self, bdd_ptr bdd, bdd_ptr* result_array, const int array_len )
bdd_pick_all_terms
BddEnc.c
bdd_ptr BddEnc_pick_one_input_rand( const BddEnc_ptr self, bdd_ptr inputs )
bdd_pick_one_minterm_rand
BddEnc.c
bdd_ptr BddEnc_pick_one_input( const BddEnc_ptr self, bdd_ptr inputs )
bdd_pick_one_minterm
BddEnc.c
bdd_ptr BddEnc_pick_one_state_rand( const BddEnc_ptr self, bdd_ptr states )
bdd_pick_one_minterm_rand
BddEnc.c
bdd_ptr BddEnc_pick_one_state( const BddEnc_ptr self, bdd_ptr states )
bdd_pick_one_minterm
BddEnc.c
void BddEnc_pop_status( BddEnc_ptr self )
BddEnc.c
void BddEnc_print_bdd_begin( BddEnc_ptr self, node_ptr symbols, boolean changes_only )
BddEnc.c
void BddEnc_print_bdd_end( BddEnc_ptr self )
BddEnc.c
int BddEnc_print_bdd( BddEnc_ptr self, bdd_ptr bdd, FILE* file )
BddEnc.c
void BddEnc_print_set_of_inputs( BddEnc_ptr self, bdd_ptr inputs, boolean changes_only, FILE* file )
BddEnc.c
void BddEnc_print_set_of_state_input_pairs( BddEnc_ptr self, bdd_ptr state_input_pairs, boolean changes_only, FILE* file )
BddEnc.c
void BddEnc_print_set_of_states( BddEnc_ptr self, bdd_ptr states, boolean changes_only, FILE* file )
BddEnc.c
void BddEnc_print_vars_in_cube( BddEnc_ptr self, bdd_ptr cube, node_ptr list_of_sym, FILE* file )
BddEnc.c
void BddEnc_push_status_and_reset( BddEnc_ptr self )
BddEnc.c
add_ptr BddEnc_state_var_to_next_state_var_add( const BddEnc_ptr self, add_ptr add )
BddEnc.c
bdd_ptr BddEnc_state_var_to_next_state_var( const BddEnc_ptr self, bdd_ptr bdd )
BddEnc.c
void BddEnc_write_order( const BddEnc_ptr self, const char * output_order_file_name, const VarOrderingType dump_type )
Compile_ReadOrder
BddEnc.c
static void bdd_enc_accumulate_input_variables_cube( BddEnc_ptr self, add_ptr add )
BddEnc.c
static void bdd_enc_accumulate_next_state_variables_cube( BddEnc_ptr self, add_ptr add )
BddEnc.c
static void bdd_enc_accumulate_state_variables_cube( BddEnc_ptr self, add_ptr add )
BddEnc.c
static void bdd_enc_add_input_var_to_minterm_vars( BddEnc_ptr self )
BddEnc.c
static void bdd_enc_add_input_var( BddEnc_ptr self, node_ptr name, boolean flag )
bdd_enc_add_state_var
BddEnc.c
static void bdd_enc_add_next_state_var_to_minterm_vars( BddEnc_ptr self )
BddEnc.c
static void bdd_enc_add_state_var_to_minterm_vars( BddEnc_ptr self )
BddEnc.c
static void bdd_enc_add_state_var( BddEnc_ptr self, node_ptr name, boolean flag )
bdd_enc_add_state_var
BddEnc.c
static void bdd_enc_begin_group( BddEnc_ptr self )
bdd_enc_end_group
BddEnc.c
static add_ptr bdd_enc_binary_op( BddEnc_ptr self, ADDPFDAA op, node_ptr n, int resflag, int argflag1, int argflag2, node_ptr context )
n
and a
binary operation op
. Extracts from n the operands
and evaluates them. The binary operator op
is then applied
to these partial results. The sign of the partial results and of the
result depends respectively from the flags argflag1
,
argflag2
and resflag
.
- See Also
eval
unary_op
ternary_op
quaternary_op
- Defined in
BddEnc.c
static void
bdd_enc_cache_deinit(
BddEncCache_ptr self
)
- Private deinitializer, called by the destructor
- See Also
bdd_enc_cache_init
- Defined in
BddEncCache.c
static void
bdd_enc_cache_init(
BddEncCache_ptr self,
BddEnc_ptr enc
)
- Private initializer, called by the constructor
- See Also
bdd_enc_cache_deinit
- Defined in
BddEncCache.c
static void
bdd_enc_deinit(
BddEnc_ptr self
)
- Called by the destructor
- Defined in
BddEnc.c
static int
bdd_enc_end_group(
BddEnc_ptr self
)
- All variables added between the calls to
begin_group and this method will be grouped. If only one var has been
added, no group will be created.
The dynamic reordering, if was enabled before calling begin_group, is
re-enabled.
Returns the number of vars really blocked
- See Also
bdd_enc_begin_group
- Defined in
BddEnc.c
static add_ptr
bdd_enc_eval_recur_case_atom(
BddEnc_ptr self,
Expr_ptr expr,
node_ptr ctx
)
- The expression
n
is recursively
compiled in ADD:
- If it is an ATOM:
- If it is a program parameter, then its actual name is
extracted from the parameter hash, and it is evaluated. The
result of evaluation is returned.
- If it is a constant, then the corresponding ADD is returned
back.
- If it is a binary operator, then the operands are evaluated,
and then the binary operator is applied to the operands.
- See Also
eval
get_definition
- Defined in
BddEnc.c
static add_ptr
bdd_enc_eval_recur_case_dot_array(
BddEnc_ptr self,
Expr_ptr expr,
node_ptr ctx
)
-
- Defined in
BddEnc.c
static add_ptr
bdd_enc_eval_recur(
BddEnc_ptr self,
Expr_ptr expr,
node_ptr ctx
)
-
- Defined in
BddEnc.c
static add_ptr
bdd_enc_eval(
BddEnc_ptr self,
Expr_ptr expr,
node_ptr context
)
- This function takes an expression in input and
gives as output the corresponding ADD.
This function if receives in input a domain variables, it returns as
its evaluation the ADD representing its boolean encoding. It has as
leaves the value associated to that path.
For instance consider the declaration:
VAR x : 1..6;
it is encoded with three boolean variables as below:
x1
/\
1/ \0
/ \
/ \
x2 x2
/\ / \
/ \ | \
x3 \ x3 \
/ \ \ / \ \
/ \ | / \ \
1 5 3 2 6 4
If the expression is complex, then it recursively apply to the
operands, and then apply the operation to the operands, returning
the resulting ADD. Returned ADD is referenced
- See Also
eval_recur
- Defined in
BddEnc.c
static add_ptr
bdd_enc_get_input_variables_add(
const BddEnc_ptr self
)
- Use this to retrieve value stored into the
corresponding class member. Returned value is referenced
- Defined in
BddEnc.c
static add_ptr
bdd_enc_get_next_state_variables_add(
const BddEnc_ptr self
)
- Use this to retrieve value stored into the
corresponding class member. Returned value is referenced
- Defined in
BddEnc.c
static add_ptr
bdd_enc_get_state_variables_add(
const BddEnc_ptr self
)
- Use this to retrieve value stored into the
corresponding class member. Returned value is referenced
- Defined in
BddEnc.c
static add_ptr
bdd_enc_get_var_mask_add_recur(
BddEnc_ptr self,
add_ptr var_encoding,
add_ptr cube
)
- Private method that recursively calculates the mask of
the var encoding passed as argument. Passed cube is the cube of
the encoding, used while visiting the encoding, in order to find
indexes of sub-variable. Returned add is referenced, and the
automatic reordering *must* be disabled before calling this
method.
- Defined in
BddEnc.c
static add_ptr
bdd_enc_get_vars_list_mask(
BddEnc_ptr self,
NodeList_ptr vars
)
- Private service used by higher level mask-related
methods
- Defined in
BddEnc.c
static add_ptr
bdd_enc_if_then_else_op(
BddEnc_ptr self,
node_ptr node,
node_ptr context
)
- Evaluates if_then_else expressions returning the
ADD representing IF ifarg THEN thenarg ELSE elsarg, where
ifarg
, thenarg
, elsearg
are the ADD
obtained by evaluating ifexp
, thenexp
,
elseexp
respectively in context context
. The
resulting ADD is saved in the ADD hash before returning it to the
calling function.
- See Also
add_ifthenelse
- Defined in
BddEnc.c
static void
bdd_enc_init(
BddEnc_ptr self,
Encoding_ptr generic_encoding,
DdManager* dd
)
- Partial initializer. Call BddEnc_encode_vars to
complete
- See Also
BddEnc_encode_vars
- Defined in
BddEnc.c
static void
bdd_enc_pre_encode(
BddEnc_ptr self
)
-
- Defined in
BddEnc.c
static add_ptr
bdd_enc_quaternary_op(
BddEnc_ptr self,
ADDPFDAAII op,
node_ptr n,
int resflag,
int argflag1,
int argflag2,
node_ptr context
)
- Takes in input the expression
n
and a
quaternary operation op
. Extracts from n the operands
and evaluates them.
The third and fourth arguments have to evaluate to numbers. And
op
is a function that takes as input two ADD and two integers.
The quaternary operator op
is then applied to these partial
results. The sign of the partial result and of the result depends
respectively from the flags argflag1
, argflag2
and
resflag
.
- See Also
eval
unary_op
binary_op
ternary_op
- Defined in
BddEnc.c
static void
bdd_enc_set_input_variables_add(
BddEnc_ptr self,
add_ptr add
)
- Sets both members input_variables_add
and input_variables_bdd. Always use this to set the value of this member
- Defined in
BddEnc.c
static void
bdd_enc_set_next_state_variables_add(
BddEnc_ptr self,
add_ptr add
)
- Sets both members state_variables_add
and state_variables_bdd. Always use this to set the value of this member
- Defined in
BddEnc.c
static void
bdd_enc_set_state_variables_add(
BddEnc_ptr self,
add_ptr add
)
- Sets both members state_variables_add
and state_variables_bdd. Always use this to set the value of this member
- Defined in
BddEnc.c
static add_ptr
bdd_enc_ternary_op(
BddEnc_ptr self,
ADDPFDAII op,
node_ptr n,
int resflag,
int argflag,
node_ptr context
)
- Takes in input the expression
n
and a
ternary operation op
. Extracts from n the operands
and evaluates them.
The second and third arguments have to evaluate to numbers. And
op
is a function that takes as input an ADD an two integers.
The ternary operator op
is then applied to these partial
results. The sign of the partial result and of the result depends
respectively from the flags argflag
and resflag
.
- See Also
eval
unary_op
binary_op
quaternary_op
- Defined in
BddEnc.c
static add_ptr
bdd_enc_unary_op(
BddEnc_ptr self,
ADDPFDA op,
node_ptr n,
int resflag,
int argflag,
node_ptr context
)
- Takes in input the expression
n
and a
unary operation op
. Evaluates n and applies to this
partial result the unary operator op
. The sign of the
partial result and of the result depends respectively from the flag
argflag
and resflag
.
- See Also
eval
binary_op
ternary_op
quaternary_op
- Defined in
BddEnc.c
static assoc_retval
hash_bdd_free(
char* key,
char* data,
char* arg
)
- Used when destroying NodeList containing BDDs
- Defined in
BddEnc.c
static assoc_retval
hash_dup_add(
char* key,
char* add,
char* ddmgr
)
- Called when pushing the status
- Defined in
BddEncCache.c
static assoc_retval
hash_free_add_evaluating(
char* key,
char* data,
char* arg
)
- Called when pushing the status, and during
deinitialization
- Defined in
BddEncCache.c
static assoc_retval
hash_node_free(
char* key,
char* data,
char* arg
)
- Used when destroying node list containing node_ptr
- Defined in
BddEnc.c
(
)
- Used only by method BddEncCache_push_status_and_reset
- Defined in
BddEncCache.c
(
)
- Used only by method BddEncCache_push_status_and_reset
- Defined in
BddEncCache.c