node_ptr AddOneCluster( CPCluster_Info_t * Ci, node_ptr old_clusters, bdd_ptr vars )
optional
compileFsmUtil.c
int CPCLuster_equal( CPCluster_Info_t * A, CPCluster_Info_t * B )
compileFsmUtil.c
static int CPCheckMonolithic( DdManager * dd, node_ptr Clist, bdd_ptr Mon_T )
compileFsmUtil.c
int CPCheckQuantificationSchedule( DdManager * dd, node_ptr Cl_list )
compileFsmUtil.c
CPCluster_Info_t * CPClusterInfoAlloc( )
compileFsmUtil.c
void CPClusterInfoFree( DdManager * dd, CPCluster_Info_t * CI )
compileFsmUtil.c
node_ptr CPDeleteCluster( node_ptr source, CPCluster_Info_t * el )
compileFsmUtil.c
void CPDupClustersList( DdManager * dd, node_ptr CL, node_ptr * newCL )
compileFsmUtil.c
void CPFreeClustersList( DdManager * dd, node_ptr CL )
compileFsmUtil.c
void CPPrintClustersInfo( FILE * fp, DdManager * dd, node_ptr ClusterList, node_ptr var_list )
compileFsmUtil.c
int CommandBuildBooleanModel( int argc, char ** argv )
compileCmd.c
int CommandBuildFlatModel( int argc, char ** argv )
compileCmd.c
int CommandBuildModel( int argc, char ** argv )
compileCmd.c
int CommandCPPrintClusterInfo( int argc, char ** argv )
compileCmd.c
int CommandCheckWff( int argc, char ** argv )
compileCmd.c
int CommandEncodeVariables( int argc, char ** argv )
compileCmd.c
int CommandFlattenHierarchy( int argc, char ** argv )
compileCmd.c
int CommandGetInternalStatus( int argc, char ** argv )
compileCmd.c
int CommandGoBmc( int argc, char ** argv )
compileCmd.c
int CommandGo( int argc, char ** argv )
compileCmd.c
int CommandIwls95PrintOption( int argc, char ** argv )
compileCmd.c
int CommandProcessModel( int argc, char ** argv )
compileCmd.c
int CommandShowVars( int argc, char ** argv )
compileCmd.c
int CommandWriteModelFlatBool( int argc, char ** argv )
compileCmd.c
int CommandWriteModelFlat( int argc, char ** argv )
compileCmd.c
int CommandWriteOrder( int argc, char ** argv )
compileCmd.c
static add_ptr CompileEncodeVarRecur( node_ptr name, node_ptr range, int curlevel, int num, boolean is_input, boolean flag )
x1 1/ \0 x2 \ / \ \ a c bWhere (x1 and x2) represents (X == a), while (x1 and not x2) represents (X == b), and (x1 = 0) represents (X == c).
compileEncode.c
bdd_ptr Compile_BuildInitBdd( node_ptr list_variables )
compileUtil.c
bdd_ptr Compile_BuildInvarBdd( node_ptr list_variables, add_ptr assumption )
compileUtil.c
CP_Ptr Compile_BuildModelIwls95CP( node_ptr list_variables, Iwls95OptionStruct_t * Options, add_ptr assumption )
next(x) := expr
). This initializes the set of clusters.
Compile_BuildModelMonolithic
Compile_BuildModelThreshold
compileIwls95.c
bdd_ptr Compile_BuildModelMonolithicBdd( node_ptr list_variables, bdd_ptr assumption )
Compile_CompileModel
compileMono.c
CP_Ptr Compile_BuildModelMonolithic( node_ptr list_variables, bdd_ptr assumption )
Compile_CompileModel
compileMono.c
CP_Ptr Compile_BuildModelThreshold( node_ptr list_variables, int threshold, bdd_ptr assumption )
Compile_BuildModelMono
Compile_BuildModelIwls95
compileThreshold.c
void Compile_BuildVarsBdd( )
Compile_EncodeVar
Compile_ReadOrder
dd_new_var_block
compileUtil.c
CP_Ptr Compile_CPAddClusterAndFillSchedule( CP_Ptr trans, bdd_ptr tableau_bdd )
compileFsmUtil.c
void Compile_CheckProgram( node_ptr procs, node_ptr spec_expr, node_ptr ltlspec_expr, node_ptr invar_expr, node_ptr fair_expr )
compileCheck.c
int Compile_CheckWff( node_ptr wff, node_ptr context )
check_wff_recur
compileCheckWff.c
void Compile_EncodeVarsInit( )
compileEncode.c
add_ptr Compile_EncodeVar( node_ptr name, node_ptr range, boolean is_input, boolean flag )
CompileEncodeVarRecur
compileEncode.c
void Compile_End( )
compileCmd.c
void
Compile_FlattenHierarchy(
node_ptr root_name, the ATOM
representing the module at the top of the hierarchy.
node_ptr name, the name of the module at the top of the hierarchy.
node_ptr * trans, the list of TRANS actually recognized
node_ptr * init, the list of INIT actually recognized
node_ptr * invar, the list of INVAR actually recognized
node_ptr * spec, the list of SPEC actually recognized
node_ptr * compute, the list of COMPUTE actually recognized
node_ptr * ltl_spec, the list of LTLSPEC actually recognized
node_ptr * invar_spec, the list of INVARSPEC actually recognized
node_ptr * fair, the list of FAIR actually recognized
node_ptr * procs, the list of processes actually recognized
node_ptr actual the actual module arguments
)
compileFlattenHierarchy
compileFlatten.c
node_ptr Compile_FlattenSexpExpandDefine( node_ptr sexp, node_ptr context )
Flatten_GetDefinition
compileFlatten.c
node_ptr Compile_FlattenSexp( node_ptr sexp, node_ptr context )
Flatten_GetDefinition
compileFlatten.c
void
Compile_FlattenTableau(
node_ptr root_name, the ATOM
representing the module at the top of the hierarchy.
node_ptr name, the name of the module at the top of the hierarchy.
node_ptr * trans, the list of TRANS actually recognized
node_ptr * init, the list of INIT actually recognized
node_ptr * invar, the list of INVAR actually recognized
node_ptr * spec, the list of SPEC actually recognized
node_ptr * compute, the list of COMPUTE actually recognized
node_ptr * ltl_spec, the list of LTLSPEC actually recognized
node_ptr * invar_spec, the list of INVARSPEC actually recognized
node_ptr * fair, the list of FAIR actually recognized
node_ptr * procs, the list of processes actually recognized
node_ptr actual the actual module arguments
)
Compile_FlattenHierarchy
compileFlattenHierarchy
compileFlatten.c
node_ptr Compile_GetOrdering( )
compileEncode.c
void Compile_InitializeBuildModel( )
optional
compileUtil.c
void Compile_InitializeSexpBuildModel( node_ptr all_variables )
optional
compileUtil.c
void Compile_Init( )
compileCmd.c
node_ptr Compile_ReadOrder( const char * input_order_file )
orderfile ::= variable NL variable ::= complex_atom complex_atom ::= simple_atom | simple_atom DOT complex_atom simple_atom ::= atomWhere NL is a new line, and DOT is the period character.
write_order
compileOrd.c
int Compile_WriteFlattenBool( FILE * out, Fsm_SexpPtr fsm, cmp_struct_ptr s )
compileWriteBool.c
int Compile_WriteFlatten( FILE * out, cmp_struct_ptr s )
compileWriteFlat.c
void Compile_WriteOrder( const char * output_order_file_name, int force )
Compile_ReadOrder
compileOrd.c
Set_t ComputeCOI( Set_t base )
compileCone.c
static node_ptr Flatten_FlattenSexpRecur( node_ptr sexp, node_ptr context )
Compile_FlattenSexp
Compile_FlattenSexpExpandDefine
compileFlatten.c
static node_ptr Flatten_GetDefinition( node_ptr atom )
compileFlatten.c
Set_t Formula_GetDependencies( node_ptr formula, node_ptr context )
formulaGetDefinitionDependencies
compileCone.c
Set_t Formulae_GetDependencies( node_ptr formula, node_ptr fairness )
compileCone.c
static Iwls95Cluster_Info_t * Iwls95ClusterInfoAlloc( )
compileIwls95.c
void Iwls95ClusterInfoFree( DdManager * dd, Iwls95Cluster_Info_t * CI )
compileIwls95.c
static float Iwls95ComputeBenefit( Iwls95Cluster_Info_t * Ci, Iwls95OptionStruct_t * Option )
compileIwls95.c
bdd_ptr Iwls95ComputeCLustersCube( DdManager * dd, node_ptr set_of_clusters )
compileIwls95.c
static void Iwls95ComputeClusterInfoAux( DdManager * dd, node_ptr Q, double * x_c, double * z_c, double * M_c, bdd_ptr PSPI, bdd_ptr NS )
Iwls95ComputeClusterInfo
Iwls95OptionStruct
Iwls95ClusterInfo_struct
compileIwls95.c
node_ptr Iwls95ComputeClusterInfo( DdManager * dd, The DD manager node_ptr Q, The list of clusters whose fields have to be filled bdd_ptr PS, Cube of present state variables bdd_ptr PI, Cube of input variables bdd_ptr NS Cube of next state variables )
Q
compileIwls95.c
bdd_ptr Iwls95Compute_Supp_Q_Ci( DdManager * dd, node_ptr Q, Iwls95Cluster_Info_t * Ci )
compileIwls95.c
bdd_ptr Iwls95CubeAnd( DdManager * dd, bdd_ptr A, bdd_ptr B )
compileIwls95.c
static node_ptr Iwls95DeleteCluster( node_ptr source, Iwls95Cluster_Info_t * el )
compileIwls95.c
void Iwls95FreeClustersList( DdManager * dd, node_ptr CL )
compileIwls95.c
Iwls95OptionStruct_t * Iwls95GetOptions( )
compileIwls95.c
static void Iwls95MakePartition( DdManager * dd, node_ptr Ti_list, node_ptr * new_Ti_list, Iwls95OptionStruct_t * Options, bdd_ptr PS, bdd_ptr PI, bdd_ptr NS )
compileIwls95.c
void Iwls95OrderClusters( DdManager * dd, node_ptr Unordered, node_ptr * Ordered, bdd_ptr PS, bdd_ptr PI, bdd_ptr NS, Iwls95OptionStruct_t * Options )
Iwls95ClusterInfo_struct
Iwls95OptionStruct
compileIwls95.c
int Iwls95PrintOption( FILE * fp )
compileIwls95.c
static int MixedCLuster_equal( CPCluster_Info_t * A, Iwls95Cluster_Info_t * B )
compileIwls95.c
static node_ptr add2bexpr_recur( DdManager * dd, add_ptr bool_add, boolean in_next, boolean allow_nondet, st_table * lc )
add2bexpr
range_check
compileBEval.c
static node_ptr add2bexpr( add_ptr bool_add, boolean in_next, boolean allow_nondet )
add2bexpr_recur
mk_new_var
compileBEval.c
double add_count_states( DdManager * dd, bdd_ptr fn )
compileEncode.c
static add_ptr add_divide( DdManager * dd, add_ptr a, add_ptr b )
compileEval.c
static add_ptr add_gt( DdManager * dd, add_ptr a, add_ptr b )
compileEval.c
static add_ptr add_lt( DdManager * dd, add_ptr a, add_ptr b )
compileEval.c
static add_ptr add_minus( DdManager * dd, add_ptr a, add_ptr b )
compileEval.c
static add_ptr add_mod( DdManager * dd, add_ptr a, add_ptr b )
compileEval.c
static add_ptr add_plus( DdManager * dd, add_ptr a, add_ptr b )
compileEval.c
add_ptr add_shift_backward( DdManager * dd, add_ptr fn )
add_shift_forward
compileEncode.c
add_ptr add_shift_forward( DdManager * dd, add_ptr fn )
add_shift_backward
compileEncode.c
static add_ptr add_times( DdManager * dd, add_ptr a, add_ptr b )
compileEval.c
static add_ptr add_union( DdManager * dd, add_ptr a, add_ptr b )
compileEval.c
void add_var_to_minterm_vars( int vn )
compileEncode.c
static int affinity_move_clusters( node_ptr List, node_ptr * NewRelationList, int threshold, node_ptr * L, heap H )
compileAffinity.c
static double bdd_compute_affinity( bdd_ptr a, bdd_ptr b )
compileAffinity.c
double bdd_count_states( DdManager * dd, add_ptr fn )
compileEncode.c
bdd_ptr bdd_pick_one_state_rand( DdManager * dd, bdd_ptr fn )
bdd_pick_one_minterm_rand
compileEncode.c
bdd_ptr bdd_pick_one_state( DdManager * dd, bdd_ptr fn )
bdd_pick_one_minterm
compileEncode.c
bdd_ptr bdd_shift_backward( DdManager * dd, bdd_ptr fn )
bdd_shift_forward
bdd_permute
compileEncode.c
bdd_ptr bdd_shift_forward( DdManager * dd, bdd_ptr fn )
bdd_shift_backward
bdd_permute
compileEncode.c
static add_ptr binary_op( DdManager * dd, 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
compileEval.c
void
build_real_state_variables(
)
- Computes the real_state_variables, a
list of ADDs, one for each symbolic scalar variable representing its
boolean encoding.
- Side Effects real_state_variables is computed.
- See Also
eval
- Defined in
compileUtil.c
static void
check_assign_both(
node_ptr v,
int node_type,
int lineno
)
- Checks if there exists in the model an
assignments of type node_type for variable v. If
such an assignment exists, then an error is generated.
- Defined in
compileCheck.c
static void
check_assign(
node_ptr n,
node_ptr context,
int mode
)
- This function detects either multiple or
circular assignments in "context" regarding to "mode".
If mode is equal to 0 (zero) then it checks for multiple assignments
or symbols redefinition. Otherwise it performs checks for circular
assignments.
- Defined in
compileCheck.c
static void
check_circular_assign(
node_ptr n,
node_ptr context,
int is_next
)
- Checks for circular assignments in the model. If
there are any, then an error is generated.
- Defined in
compileCheck.c
static void
check_circ(
node_ptr n,
node_ptr context,
int is_next
)
- This function checks for circular definition of
any kind. This function is able to detect circularity of the
following kinds:
next(x) := alpha(next(x))
next(x) := next(alpha(x))
any combination of the two above.
x := alpha(x)
where alpha(x)
(alpha(next(x))
) is a
formula in which the variable x
(next(x)
)
occurs. Notice that next(alpha(x))
can be rewritten in
term of next(x)
, since the next operator distributes
along all kind of operators.
- Defined in
compileCheck.c
static wff_result_type
check_definition(
node_ptr n
)
- Given the symbol represented by
n
, this
function returns the its definition as a wff result.
- See Also
Compile_CheckWff
- Defined in
compileCheckWff.c
static wff_result_type
check_wff_recur(
node_ptr wff,
node_ptr context
)
- Performs the recursive step of the
Compile_CheckWff
function.
- Side Effects wfftype_hash
- See Also
Compile_CheckWff
- Defined in
compileCheckWff.c
void
check_wff(
node_ptr wff,
node_ptr context
)
- It analizes a formula on the basis of its arguments and
operators and returns the domain type of the result that the formula will
generate. Possible results are:
- BOOLEAN
- SYMBOLIC
- NUMERIC
- ERROR (erroneous mismatch between arguments)
- NIL (internal error)
- See Also
Compile_CheckWff
check_wff_recur
- Defined in
compileCheckWff.c
static void
coiInit(
)
- Computes the COI of all the variables in the current model
- See Also
ComputeCOI
- Defined in
compileCone.c
static node_ptr
compileBuildBasicCPRecur(
node_ptr clusters,
node_ptr sexp,
add_ptr assumption
)
- Recursively build the portioned transition
relation. When the size of the current cluster is greater than the
threshold found in the options, than a new cluster is created. The
partitions are simplified using the given assumption.
- Side Effects None
- Defined in
compileFsmUtil.c
node_ptr
compileBuildElementaryBDDList(
node_ptr list_variables,
add_ptr assumption
)
- Builds BDD list from given variables list.
- Defined in
compileFsmUtil.c
static bdd_ptr
compileBuildSchedule(
node_ptr l,
bdd_ptr vars
)
- Computes the schedule for the given list of clusters
- Side Effects required
- See Also
optional
- Defined in
compileFsmUtil.c
void
compileCPBuildSchedule(
node_ptr l,
bdd_ptr vars
)
- Computes the schedule for the given list of clusters.
Wrapper.
- Defined in
compileFsmUtil.c
void
compileCPCheckPartitionedTransition(
CP_Ptr transition,
node_ptr list_variables,
bdd_ptr assumption
)
- Check the equality with monolithic transition relation,
and check the quantification schedule.
- See Also
CPCheckMonolithic
CPCheckQuantificationSchedule
- Defined in
compileFsmUtil.c
void
compileCPMakeAffinityClusters(
DdManager * dd,
node_ptr RelationList,
node_ptr * NewRelationList,
int threshold
)
- OPTIMIZED affinity clustering
- Defined in
compileAffinity.c
void
compileCPMakeClusters(
DdManager * dd,
node_ptr RelationList,
node_ptr * NewRelationList,
int threshold
)
- The clusters are formed by taking the product in
order. Once the BDD size of the current cluster reaches a threshold, a new
cluster is created.
- Defined in
compileFsmUtil.c
static void
compileFlattenHierarchy(
node_ptr root_name, the ATOM
representing the module at the top of the hierarchy.
node_ptr name, the name of the module at the top of the hierarchy.
node_ptr * trans, the list of TRANS actually recognized
node_ptr * init, the list of INIT actually recognized
node_ptr * invar, the list of INVAR actually recognized
node_ptr * spec, the list of SPEC actually recognized
node_ptr * compute, the list of COMPUTE actually recognized
node_ptr * ltl_spec, the list of LTLSPEC actually recognized
node_ptr * invar_spec, the list of INVARSPEC actually recognized
node_ptr * fair, the list of FAIR actually recognized
node_ptr * assign, the list of ASSIGN actually recognized
node_ptr * procs, the list of processes actually recognized
node_ptr actual the actual module arguments
)
- Traverses the module hierarchy and extracts the
information needed to compile the automaton. The hierarchy of modules
is flattened, the variables are contextualized, the various parts of
the model read in are extracted (i.e. the formulae to be verified,
the initial expressions, ...)...
Notice that this function only manage s_expr and not ADD or BDD.
- Side Effects None
- Defined in
compileFlatten.c
static void
compileFlattenProcessRecur(
node_ptr assign,
node_ptr context,
node_ptr running
)
- Recursive definition of Compute_FlattenProcess
- Defined in
compileFlatten.c
node_ptr
compileFlattenProcess(
node_ptr procs_expr
)
- This functions takes in input the list of
processes resulting from the instantiation step and builds a hash
table ASSIGNthat associates to each variable the following
informations:
- init(var) -> (list_i init_assign_i)
where init_assign_i is the right side of the initialization
assignement of the variable var in process i.
- next(var) -> (list_i Pi.running -> next_assign_i)
where next_assign_i is the right side of the next
assignement for the variable var in process i.
When other processes not affecting the variable are running,
the variable stutter.
- var -> (list_i Pi.running -> normal_assign_i)
where normal_assign_i is the right side of the
normal (invariant) assignement for the variable var
in process i. When other variables not affecting the
variable are running, the variable is free to evolve randomly
assuming a value among its possible values.
- Defined in
compileFlatten.c
static void
compileFlattenSexpModelRecur(
node_ptr expr,
int type
)
- optional
- Side Effects required
- See Also
optional
- Defined in
compileFlatten.c
void
compileFlattenSexpModel(
node_ptr init_expr,
node_ptr invar_expr,
node_ptr trans_expr
)
- Associate to each variables the small pieces of
the trans where the variable occurs, in a way similar to
Compile_FlattenProcess
- See Also
Compile_FlattenProcess
- Defined in
compileFlatten.c
static void
create_boolean_input_var(
node_ptr name,
int num,
int level
)
- optional
- Side Effects required
- See Also
optional
- Defined in
compileEncode.c
void
create_boolean_state_var(
node_ptr name,
int num,
int level
)
- optional
- Side Effects required
- See Also
optional
- Defined in
compileEncode.c
static void
create_process_symbolic_variables(
node_ptr procs_expr
)
- Creates the internal process selector
variable. The internal process selector variable is as default
positioned at the top of the ordering. It is attached to
input_variables and all_variables too.
- Side Effects input_variables and
all_variables are affected.
- Defined in
compileFlatten.c
node_ptr
detexpr2bexpr(
node_ptr expr
)
- Takes an scalar expression intended to evaluate
to boolean, maps through booleans down to the atomic scalar
propositions, builds the corresponding boolean function, and returns
the resulting boolean expression.
The conversion of atomic scalar proposition is currently performed
by generating the corresponding ADD, and then printing it in terms
of binary variables.
An error is returned is determinization variables are introduced in
the booleanization process.
- Side Effects None
- See Also
expr2bexpr
expr2bexpr_recur
- Defined in
compileBEval.c
static int
divide_op(
int a,
int b
)
- Divide two integers, if a division by zero is
performed, then an error occurs.
- Side Effects required
- Defined in
compileEval.c
add_ptr
enforce_definition(
node_ptr n
)
- Returns the ADD of the definition of symbol
n
if defined, else prints an error message and then
exits if you are not in the interactive shell.
- See Also
get_definition
- Defined in
compileEval.c
int
eval_num(
node_ptr e,
node_ptr context
)
- Evaluate the NUMBER represented by
e
in
context context
. NUMBERS can be encoded in
different ways in different processes.
- See Also
enforce_constant
eval
- Defined in
compileEval.c
static add_ptr
eval_recur(
node_ptr expr,
node_ptr context
)
- 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
compileEval.c
static add_ptr
eval_sign(
add_ptr a,
int flag
)
- Given the ADD
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).
- See Also
eval
- Defined in
compileEval.c
add_ptr
eval_simplify(
node_ptr expr,
node_ptr context,
add_ptr assumption
)
- This function takes as input an expression
n
evaluates it in context context
and this
partial result is then simplified using the ADD assumption
.
- See Also
eval
add_simplify_assuming
- Defined in
compileEval.c
static node_ptr
eval_struct_recur(
node_ptr n,
node_ptr context
)
- Performs the recursive step of
eval_struct
.
- See Also
eval_struct
- Defined in
compileEval.c
node_ptr
eval_struct(
node_ptr n,
node_ptr context
)
- Takes an expression representing an identifier
and recursively evaluates it. This function is repsonsible of
building the symbolic name of the given symbol
n
in
module instance context
. If the given symbol is a formal
parameter of the module instance, than the actual parameter is
built. If the given symbol is an array, than the expression
referring to the element of the array must evaluate to an unique
integer (not to a set of integers) in the range of array bound.
- See Also
eval_struct_recur
- Defined in
compileEval.c
node_ptr
eval_tree(
node_ptr nodes,
node_ptr context
)
- This function takes as input a list of
expressions, and returns as output the list of the corresponding
ADD. For each element of the list a call to
eval
is performed.
- See Also
eval
- Defined in
compileEval.c
add_ptr
eval(
node_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.
- See Also
eval_recur
- Defined in
compileEval.c
static node_ptr
expr2bexpr_recur(
node_ptr expr,
boolean in_next,
boolean allow_nondet
)
- Takes an expression intended to evaluate to boolean,
maps through booleans down to the atomic scalar propositions,
builds the corresponding boolean function,
and returns the resulting boolean expression.
The conversion of atomic scalar proposition is currently performed
by generating the corresponding ADD, and then printing it in terms
of binary variables.
The introduction of determinization variables is allowed only if flag
allow_nondet is set to true.
- Side Effects None
- See Also
expr2bexpr
detexpr2bexpr
- Defined in
compileBEval.c
node_ptr
expr2bexpr(
node_ptr expr
)
- Takes an scalar expression intended to evaluate
to boolean, maps through booleans down to the atomic scalar
propositions, builds the corresponding boolean function, and returns
the resulting boolean expression.
The conversion of atomic scalar proposition is currently performed
by generating the corresponding ADD, and then printing it in terms
of binary variables.
- Side Effects None
- See Also
detexpr2bexpr
expr2bexpr_recur
- Defined in
compileBEval.c
static Set_t
formulaGetDefinitionDependencies(
node_ptr formula
)
- This function computes the dependencies of an
atom. If the atom corresponds to a variable then the singleton with
the variable is returned. If the atom corresponds to a "running"
condition the singleton with variable PROCESS_SELECTOR_VAR_NAME is
returned. Otherwise if the atom corresponds to a defined symbol the
dependency set corresponding to the body of the definition is
computed and returned.
- Side Effects The define_dep_hash is modified in
order to memoize previously computed dependencies of defined symbols.
- See Also
Formula_GetDependencies
- Defined in
compileCone.c
static Set_t
formulaGetDependenciesRecur(
node_ptr formula,
node_ptr context
)
- Recursive call to Formula_GetDependencies.
- See Also
Formula_GetDependencies
formulaGetDefinitionDependencies
- Defined in
compileCone.c
void
free_minterm_vars(
)
- Free the array necessary to extract minterms
from a BDD.
- Defined in
compileEncode.c
static void
get_bdd_input_var(
boolean flag
)
- Adds a new boolean variable to the DD
manager. This function is used to create the boolean variables
needed to encode input variables.
- See Also
get_bdd_state_var
- Defined in
compileEncode.c
static void
get_bdd_state_var(
boolean flag
)
- optional
- Side Effects required
- See Also
optional
- Defined in
compileEncode.c
node_ptr
get_bool_variable_name(
int i
)
- optional
- Side Effects required
- See Also
optional
- Defined in
compileEncode.c
static add_ptr
get_definition(
node_ptr n
)
- Given the symbol represented by
n
, this
function returns the ADD of its definition.
- See Also
eval
- Defined in
compileEval.c
static int
gt_op(
int a,
int b
)
- Checks if an integer is greater then the other.
- Defined in
compileEval.c
static add_ptr
if_then_else_op(
DdManager * dd,
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
compileEval.c
static void
init_check_program_recur(
node_ptr l
)
- Performs recursive step of
init_check_program. Loops over the list of process names
and inserts the process symbolic name in the check_constant_hash.
- Defined in
compileCheck.c
static void
init_check_program(
node_ptr procs_exp
)
- Initializes the data structure to perform
semantic checks. The check constant hash is filled in with the names
of the declared processes.
- Defined in
compileCheck.c
static void
instantiate_by_name(
node_ptr root_name,
node_ptr name,
node_ptr * trans,
node_ptr * init,
node_ptr * invar,
node_ptr * spec,
node_ptr * compute,
node_ptr * ltl_spec,
node_ptr * invar_spec,
node_ptr * fair,
node_ptr * assign,
node_ptr * procs,
node_ptr actual
)
- Uses root_name as root module in the
flattening of the hierarchy. The name of the module in the hierarchy
is name. First checks if the module exists. Then it checks
if the module is recursively defined, and if the case an error is
printed out. If these checks are passed, then it proceeds in the
instantiation of the body of the module.
- Defined in
compileFlatten.c
static void
instantiate_vars(
node_ptr var_list,
node_ptr mod_name,
node_ptr * trans,
node_ptr * init,
node_ptr * invar,
node_ptr * spec,
node_ptr * compute,
node_ptr * ltl_spec,
node_ptr * invar_spec,
node_ptr * fair,
node_ptr * assign,
node_ptr * procs
)
- Recursively applies instantiate_var to
a given list of variables declaration, and performs some check for
multiple variable definitions.
- See Also
instantiate_var
- Defined in
compileFlatten.c
static void
instantiate_var(
node_ptr name,
node_ptr type,
node_ptr * trans,
node_ptr * init,
node_ptr * invar,
node_ptr * spec,
node_ptr * compute,
node_ptr * ltl_spec,
node_ptr * invar_spec,
node_ptr * fair,
node_ptr * assign,
node_ptr * procs,
node_ptr context
)
- It takes as input a variable and a context, and
depending on the type of the variable some operation are performed in order to
instantiate it in the given context:
- BOOLEAN
if the variable is of type boolean, then we add an entry in
symbol_hash
saying that the variable range is {0,1}
.
- RANGE
if the variable is a range of the form M..N
, then
we add an entry in the symbol_hash
saying that the
variable range is {M, M+1, ..., N-1, N}
. If
M
is less or equal to N
, than an error occurs.
- SCALAR
if the variable is a scalar variable whose possible values are
{a1, a2, ..., aN}
, then we add an entry in the
symbol_hash
saying that the variable range is
{a1, ..., aN}
.
- ARRAY
for each element of the array it is created the corresponding
symbol. Suppose you have the following definition "VAR
x : array 1..4 of boolean;
". We call this function
for 4 times, asking at each call i
(i
from 1
to 4) to declare the boolean variable x[i]
.
- MODULE
If the variable is an instantiation of a module, than their
arguments (if any) are contextualized, and passed as actual
parameter to instantiate_by_name with the name of the
instantiated module as root name (to extract its definition)
and as variable name as the name of the module (to perform
flattening).
- PROCESS
If the variable is of type process, than we extract the
module name and args, we perform the contextualization of the
process arguments and we perform a call to
compileFlattenHierarchy using the variable name as process
name (to perform flattening), the module name as root name (to
extract its definition) and the computed actual parameters.
The variables of type boolean, scalar, and array depending the kind
of variable instantiation mode are appended to
input_variables or to state_variables.
- See Also
instantiate_vars
- Defined in
compileFlatten.c
static void
instantiate(
node_ptr mod_def,
node_ptr mod_name,
node_ptr * trans,
node_ptr * init,
node_ptr * invar,
node_ptr * spec,
node_ptr * compute,
node_ptr * ltl_spec,
node_ptr * invar_spec,
node_ptr * fair,
node_ptr * assign,
node_ptr * procs,
node_ptr actual
)
- This function is responsible of the
instantiation of the body of a module. The module definition is
mod_def and the module name mod_name are passed as
arguments. First we instantiate the arguments of the given
module. Then it loops over the module definition searching for
defined symbols (i.e. those introduced by the keyword
DEFINE) and inserts their definition in the
symbol_hash. After this preliminary phase it loops again
over module body in order to performs the other instantiation, and
to extract all the information needed to compile the automaton,
i.e. the list of processes, the TRANS statements, the INIT
statements, ... and so on.
- See Also
instantiate_var
instantiate_vars
- Defined in
compileFlatten.c
static void
list_del(
list_entry * C
)
- Delete a cluster in support list.
- Defined in
compileAffinity.c
static list_entry *
list_entryAlloc(
)
- Allocs a list_entry
- Defined in
compileAffinity.c
static node_ptr
list_heap_add(
CPCluster_Info_t * C,
node_ptr L,
heap H
)
- Add a new entry in support list and new pairs in heap.
Pairs with a dead cluster are skipped
- Defined in
compileAffinity.c
static int
lt_op(
int a,
int b
)
- Checks if an integer is less then the other.
- Defined in
compileEval.c
static node_ptr
make_atom_set(
node_ptr l
)
- Given a range it builds the corresponding
internal representation in term of UNION.
- Defined in
compileFlatten.c
void
make_minterm_vars(
)
- Creates the array necessary to extract minterms
from a BDD.
- Defined in
compileEncode.c
static void
make_params(
node_ptr basename,
node_ptr actual,
node_ptr formal
)
- Builds the parameters of a module from the list
of formal parameters of the module itself and a basename.
There must be a one to one correspondence between the elements of
actual and formal parameters. If the number of elements of
the lists are different then, an error occurs.
- Side Effects In the param_hash, the new parameter is
associated to the old one.
- Defined in
compileFlatten.c
static int
minus_op(
int a,
int b
)
- Subtracts two integers
- Defined in
compileEval.c
static node_ptr
mk_and(
node_ptr a,
node_ptr b
)
- optional
- See Also
optional
- Defined in
compileFlatten.c
static node_ptr
mk_new_var(
)
- Creates a fresh variable name, creates the
corresponding name expressions, stores it as input variable, creates
the corresponding encoding, builds and stores the resulting variable
node.
- Side Effects A new dd variable is created.
- See Also
INT_VAR_PREFIX
det_counter
Compile_EncodeVar
- Defined in
compileBEval.c
static node_ptr
mk_true(
)
- Build truth, falsity, conditional and next expressions.
- Side Effects None
- Defined in
compileBEval.c
static node_ptr
mk_true(
)
- optional
- See Also
optional
- Defined in
compileFlatten.c
static int
mod_op(
int a,
int b
)
- Computes the modulo of the division of two
integers, if a division by zero is performed, then an error occurs.
- Defined in
compileEval.c
static node_ptr
node_divide(
node_ptr n1,
node_ptr n2
)
- Divides two integer nodes.
- Defined in
compileEval.c
node_ptr
node_equal(
node_ptr n1,
node_ptr n2
)
- This function checks if symbols
n1
and
n2
are equal, if it is then it returns the symbol
1
(that's one_number
) else the symbol 0
(that's zero_number
).
- See Also
node_setin
- Defined in
compileEval.c
static node_ptr
node_gt(
node_ptr n1,
node_ptr n2
)
- Checks if an integer node is greater then the other.
- Defined in
compileEval.c
static node_ptr
node_lt(
node_ptr n1,
node_ptr n2
)
- Checks if an integer node is less then the other.
- Defined in
compileEval.c
static node_ptr
node_minus(
node_ptr n1,
node_ptr n2
)
- Subtracts two integer nodes.
- Defined in
compileEval.c
static node_ptr
node_mod(
node_ptr n1,
node_ptr n2
)
- Computes the modulo of the division between two
integer nodes.
- Defined in
compileEval.c
node_ptr
node_plus1(
node_ptr n1
)
- Adds 1 to an integer node.
- Defined in
compileEval.c
node_ptr
node_plus(
node_ptr n1,
node_ptr n2
)
- Adds two integer nodes.
- Defined in
compileEval.c
node_ptr
node_setin(
node_ptr n1,
node_ptr n2
)
- Checks if s_expr "n1" is a subset of s_expr
"n2", if it is the case them
one_number
is returned,
else zero_number
is returned.
- See Also
node_equal
- Defined in
compileEval.c
static node_ptr
node_times(
node_ptr n1,
node_ptr n2
)
- Multiplies two integer nodes.
- Defined in
compileEval.c
static node_ptr
node_union(
node_ptr n1,
node_ptr n2
)
- This function computes the sexp resulting from
the union of s_expr "n1" and "n2".
- Defined in
compileEval.c
static node_ptr
numeric_op(
INTPFII op,
node_ptr n1,
node_ptr n2
)
- Applies generic function to two operands. The
two operands have to be integers.
- Defined in
compileEval.c
static pair *
pairAlloc(
)
- Allocates a pair
- Defined in
compileAffinity.c
int
parsecheckwffcmd(
int argc,
char ** argv,
node_ptr * pc
)
- Parses string looking for a SIMPLE / CTL / LTL/
COMPUTE expression. Return
0
if an expected expression
has been parsed, 1
otherwise. The parsed expression is
stored in pc
.
- Defined in
compileCheckWff.c
static int
plus_op(
int a,
int b
)
- Adds two integers
- Defined in
compileEval.c
static void
print_assign(
FILE * out,
node_ptr lhs,
node_ptr rhs
)
- [Prints an assignement statement
- Defined in
compileWriteFlat.c
void
print_generic_detailed_info(
FILE * file,
CP_Ptr c
)
-
- Defined in
compileFsmUtil.c
void
print_generic_part_bdd_info(
FILE * file,
CP_Ptr c
)
- optional
- Side Effects required
- See Also
optional
- Defined in
compileFsmUtil.c
void
print_generic_part_info(
FILE * file,
Fsm_BddPtr fsm,
CP_Ptr c
)
- optional
- Side Effects required
- See Also
optional
- Defined in
compileFsmUtil.c
void
print_model_statistic(
FILE * file,
Fsm_BddPtr fsm
)
- Depending the partition method used this
function prints out the statistics; i.e. the size of the transition
relation or the size of the clusters used in conjunctive partitioning.
- Defined in
compileUtil.c
void
print_state_vars(
DdManager * dd,
bdd_ptr cube,
node_ptr list_of_sym
)
- Given a cube of boolean BDD variables, this
function prints out the symbolic names of the corresponding
variables. The symbolic name of the variables to be printed out are
listed in list_of_sym.
- Side Effects None
- Defined in
compileEncode.c
void
print_state(
bdd_ptr s,
node_ptr symbols,
int changes_only
)
- Prints out the state represented by the given
minterm. If changes_only is 1, than only state variables
which assume a different value from the previous printed one are
printed out.
- Side Effects print_hash is modified.
- Defined in
compileEncode.c
static node_ptr
put_in_context(
node_ptr v
)
- Put a variable in the current "context", which
is stored in
param_context
.
- Side Effects None
- See Also
param_context
- Defined in
compileFlatten.c
static add_ptr
quaternary_op(
DdManager * dd,
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
compileEval.c
static int
range_check(
node_ptr s,
node_ptr d
)
- Returns true if the first argument is contained in the
set represented by the second, false otherwise. If the first
argument is not a CONS, then it is considered to be a singleton.
- Side Effects None
- See Also
in_list
- Defined in
compileBEval.c
static void
range_check(
node_ptr n
)
- Checks if the values of
n
is in the
range allowed for the variable. The allowed values are stored in the
global variable the_range
, which is updated each time this
function is called with the range allowed for the variable to be
checked. If the value is not in the range, then error occurs.
- Defined in
compileEval.c
void
reset_encode(
)
- Reset the counters necessary to the encoder.
- Defined in
compileEncode.c
static node_ptr
scalar_atom2bexpr(
node_ptr expr,
boolean in_next,
boolean allow_nondet
)
- Takes an atomic expression and converts it into
a cooresponding boolean expression.
The introduction of determinization variables is allowed only if flag
allow_nondet is set to true.
- Side Effects A new boolean variable can be introduced.
- See Also
add2bexpr_recur
mk_new_var
- Defined in
compileBEval.c
node_ptr
sym_intern(
char * s
)
- Builds an internal representation for a given
string. If the conversion has been performed in the past, then the
hashed value is returned back, else a new one is created, hashed and
returned. We hash this in order to allow the following:
VAR
x : {a1, a2, a3};
y : {a3, a4, a5};
ASSIGN
next(x) := case
x = y : a2;
!(x = y) : a1;
1 : a3;
esac;
i.e. to allow the equality test between x and y. This can be
performed because we internally have a unique representation of the
atom a3.
- See Also
find_atom
- Defined in
compileUtil.c
static add_ptr
ternary_op(
DdManager * dd,
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
compileEval.c
static int
times_op(
int a,
int b
)
- Multiplies two integers
- Defined in
compileEval.c
static add_ptr
unary_op(
DdManager * dd,
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
compileEval.c
static boolean
wff_is_boolean(
node_ptr l
)
- Checks if an atom is boolean or symbolic.
- See Also
wff_is_numeric
- Defined in
compileCheckWff.c
static boolean
wff_is_numeric(
node_ptr l
)
- Checks if an atom is numeric or symbolic.
- See Also
wff_is_boolean
- Defined in
compileCheckWff.c
static int
write_flatten_assign(
FILE * out
)
- Writes flattened ASSIGN declarations in SMV format on a
file.
- See Also
write_flatten_assign_recur
- Defined in
compileWriteFlat.c
static int
write_flatten_bfexpr(
FILE * out,
node_ptr n,
char * s
)
- Writes a generic expression prefixed by a given
string in SMV format on a file.
- Defined in
compileWriteBool.c
static int
write_flatten_define(
FILE * out
)
- Writes DEFINE declarations in SMV format on a
file.
- Defined in
compileWriteFlat.c
static int
write_flatten_expr(
FILE * out,
node_ptr n,
char * s
)
- Writes a generic expression prefixed by a given
string in SMV format on a file.
- Defined in
compileWriteBool.c
static int
write_flatten_expr(
FILE * out,
node_ptr n,
char * s
)
- Writes a generic expression prefixed by a given
string in SMV format on a file.
- Defined in
compileWriteFlat.c
static int
write_flatten_vars(
FILE * out,
node_ptr lov,
char * str
)
- Writes VAR declarations in SMV format on a file.
- Defined in
compileWriteBool.c
static int
write_flatten_vars(
FILE * out,
node_ptr lov,
char * str
)
- Writes VAR declarations in SMV format on a file.
- Defined in
compileWriteFlat.c
static int
write_process_selector_define(
FILE * out
)
- Writes DEFINE declarations in SMV format on a
file.
- Defined in
compileWriteFlat.c
(
)
- Indicates that the body of a define is under the
flattening, it is usde to discover possible recursive definitions.
- See Also
Flatten_GetDefinition
- Defined in
compileFlatten.c
(
)
- Indicates that the COI computation should be verbose.
- Defined in
compileCone.c
(
)
- The value used during the building of dependencies of
defined symbols to keep track that compuation is ongoing to discover
circular definitions.
- Defined in
compileCone.c
(
)
- Return value in case an error occurs.
- See Also
eval_struct_recur
- Defined in
compileEval.c
(
)
- Return value used to indicate that the evaluation of
an atom is not yet terminated and a reference to the evaluated
symbols occurs.
- See Also
get_definition
- Defined in
compileEval.c
(
)
- This is the internal symbolic name of process selector
variable. The range of this variable is the set of names of the
instantiated processes.
- Defined in
compile.h