This file provides the user routines to perform compilation of the read model into BDD.

static int 
CheckQuantificationSchedule(
  DdManager * dd, 
  node_ptr  Cl_list 
)
Let Ci and Ti be the ith cube and relation in the list. The schedule is correct iff
  1. For all Tj: j > i, S(Tj) and S(Ci) do not intersect, i.e., the variables which are quantified in Ci should not appear in the Tj for j>i.
  2. For any j, S(Ci) and S(Cj) do not intersect.

where S(T) is the set of support of the BDD T. Returns 1 if the schedule is correct, 0 otherwise. This function is implemented for checking the correctness of the clustering algorithm only.

Defined in compileIwls95.c

int 
CommandAddFairness(
  int  argc, 
  char ** argv 
)
Adds a fairness constraint to the model

Defined in compileCmd.c

int 
CommandAddInit(
  int  argc, 
  char ** argv 
)
Modifies the set of initial states.

Defined in compileCmd.c

int 
CommandAddTrans(
  int  argc, 
  char ** argv 
)
Modifies the transition relation

Defined in compileCmd.c

int 
CommandBuildModel(
  int  argc, 
  char ** argv 
)
Compiles the flattened hierarchy into BDD

Defined in compileCmd.c

int 
CommandBuildVariables(
  int  argc, 
  char ** argv 
)
Builds the BDD variables necessary to compile the model into BDD.

Defined in compileCmd.c

int 
CommandComputeFairnessConstraints(
  int  argc, 
  char ** argv 
)
Evaluates the fairness constraints

Defined in compileCmd.c

int 
CommandDumpModel(
  int  argc, 
  char ** argv 
)
Saves the current internal representation of the model

Defined in compileCmd.c

int 
CommandFlattenHierarchy(
  int  argc, 
  char ** argv 
)
Flattens the hierarchy of modules

Defined in compileCmd.c

int 
CommandGetInternalStatus(
  int  argc, 
  char ** argv 
)
Implements the get_internal_status command

Defined in compileCmd.c

int 
CommandGo(
  int  argc, 
  char ** argv 
)
Implements the go command

Defined in compileCmd.c

int 
CommandIwls95PrintClusterInfo(
  int  argc, 
  char ** argv 
)
Prints out the information of the Iwls95 clustering.

Defined in compileCmd.c

int 
CommandIwls95PrintOption(
  int  argc, 
  char ** argv 
)
Prints the Iwls95 Options.

Defined in compileCmd.c

int 
CommandProcessModel(
  int  argc, 
  char ** argv 
)
Performs the batch steps and then returns control to the interactive shell.

Defined in compileCmd.c

int 
CommandRestoreModel(
  int  argc, 
  char ** argv 
)
Restores the model after interactive model modification.

Defined in compileCmd.c

int 
CommandShowVars(
  int  argc, 
  char ** argv 
)
Shows model's symbolic variables and their values

Defined in compileCmd.c

int 
CommandWriteOrder(
  int  argc, 
  char ** argv 
)
Writes variable order to file.

Defined in compileCmd.c

static add_ptr 
CompileEncodeVarRecur(
  node_ptr  range, 
  int  curlevel, 
  int  is_input 
)
This function computes the ADD for representing the boolean encoding of a scalar variable with values listed in "range". If X has range {a, b, c}, the propositions (X == a), (X == b), (X == c) are encoded by means of two binary variables. E.g.
              x1
            1/  \0 
            x2   \ 
           /  \   \
          a    c   b
  
Where (x1 and x2) represents (X == a), while (x1 and not x2) represents (X == b), and (x1 = 0) represents (X == c).

Side Effects num_of_state_variables, num_of_input_variables are modified depending the kind of variable we are encoding.

Defined in compileEncode.c

void 
Compile_BuildVarsBdd(
    
)
This function creates the ADD variables needed to build the automaton. If an input order file is given as option, then the ordering of variables is read from it, else the order in which the variables appear in a depth first traversal of the hierarchy is used. The symbolic name of the variable is stored in an array in a position corresponding to the first index of the boolean variable created to encode it. The boolean variables needed to encode a scalar symbolic variable are grouped together, so that the ordering methods do not modify the internal order of them. If the input order file contains a subset of the variables of the model, than the variables not specified in the ordering file are created at the end of the given ordering following the order in which they appear in a depth first traversal of the hierarchy. If the input ordering file is a superset of the variables declared in the model, than the variables not appearing in the model are discarded.

Side Effects state_variables_add next_state_variables_add input_vars_add num_of_state_variables are modified.

See Also Compile_EncodeVar Compile_ReadOrder dd_new_var_block
Defined in compileUtil.c

void 
Compile_CheckProgram(
  node_ptr  procs, 
  node_ptr  spec_expr, 
  node_ptr  ltlspec_expr, 
  node_ptr  invar_expr, 
  node_ptr  fair_expr 
)
The main routine performing all the check on the read model.
First it loops on the body of processes to verify that there are no multiple assignments and circular definitions.
Then performs circularity checks on the list of SPECS, LTL SPECS, INVARIANT SPECS, FAIRNESS constraints.
The last operation performed consists in detecting multiple assignments between different modules.

Defined in compileCheck.c

void 
Compile_CompileFrame(
    
)
Computes the ADD representing what does not change between two consecutive states. i.e. it computes the frame axioms. It loops over the state variables. For each variable vname it consider the ADD Q stored in frame_hash, which is an disjunction of all the processes in whose body occurs next(vname) := ... and computes the ADD !Q -> (vname' = vname), which is conjoined with frame_add.
The result is stored in the global variable frame_add.

See Also frame_hash
Defined in compileUtil.c

void 
Compile_CompileInit(
  node_ptr  init_expr, 
  node_ptr  procs 
)
This function evaluates all the init statements listed in init_expr, then evaluates all the init() assignments in the list of processes procs. Moreover the number of states and the number of BDD nodes of the global initial set are printed out.

Side Effects The result is stored in the BDD init_bdd

Defined in compileUtil.c

void 
Compile_CompileModelConj(
  node_ptr  trans_expr, 
  node_ptr  invar_expr, 
  node_ptr  procs, 
  add_ptr  assumption 
)
This function builds the BDD representing the implicitly conjoined transition relation. The third argument (that's "assumption") is the set of states to which the transition relation has to be restricted to.

See Also Compile_CompileModelDisj Compile_CompileModelMono Compile_CompileModelIwls95
Defined in compileConj.c

void 
Compile_CompileModelDisj(
  node_ptr  trans_expr, 
  node_ptr  invar_expr, 
  node_ptr  procs_expr, 
  add_ptr  assumption 
)
This function takes as input a list of processes. For each process a partition is performed and the implicitly disjoined transition relation is computed.

Side Effects dp_trans_add is computed.

See Also Compile_CompileModel Compile_CompileModelConj Compile_CompileModeliwls95
Defined in compileDisj.c

void 
Compile_CompileModelIwls95(
  node_ptr  trans_expr, 
  node_ptr  invar_expr, 
  node_ptr  procs, 
  add_ptr  assumption 
)
Computes an implicitly conjoined transition relation, in which clusters are ordered accordingly the heuristic defined in IWLS95.
First computes the BDD representing the transition relation of the next function of each scalar variable (next(x) := expr ). This initializes the set of clusters.
Then, the list of clusters is ordered, and if necesessary recombine clusters to obtain a small number of clusters whose size in BDD nodes is smaller than a given threshold. Then clusters are ordered again.

See Also Compile_CompileModel Compile_CompileModelConj Compile_CompileModelDisj
Defined in compileIwls95.c

void 
Compile_CompileModel(
  node_ptr  trans_expr, 
  node_ptr  invar_expr, 
  node_ptr  procs, 
  add_ptr  assumption 
)
Builds the the transition relation of the model, accordingly with the partition method specified in the options.

See Also Compile_CompileModelConj Compile_CompileModelDisj Compile_CompileModelIwls95
Defined in compileUtil.c

void 
Compile_EncodeVarsInit(
    
)
Initializes the data structure relative to BDD variables, i.e. the array used to store correspondence between variable names and bdd variables, and the array used to shift forward and backward during image computation.

Defined in compileEncode.c

add_ptr 
Compile_EncodeVar(
  node_ptr  name, 
  node_ptr  range, 
  int  is_input 
)
This function encodes the variable name, whose range is range, into BDD variables. The boolean variables created are grouped together, in such a way that the BDD dynamic reordering consider them as a single block.

See Also CompileEncodeVarRecur
Defined in compileEncode.c

void 
Compile_End(
    
)
Shut down the compile package

Defined in 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 * 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

node_ptr 
Compile_GetOrdering(
    
)
It returns the list of variables corresponding to the current order of variables in the system.

Defined in compileEncode.c

void 
Compile_Init(
    
)
Initializes the compile package.

Defined in compileCmd.c

node_ptr 
Compile_ReadOrder(
  const char * input_order_file 
)
This function reads from a file the variable order to be used in the system. The grammar of the order file is as follows:
    orderfile    ::=  variable NL
    variable     ::=  complex_atom
    complex_atom ::=  simple_atom | simple_atom DOT complex_atom
    simple_atom  ::=  atom
  
Where NL is a new line, and DOT is the period character.

See Also write_order
Defined in compileOrd.c

void 
Compile_WriteOrder(
  const char * output_order_file_name, 
  int  force 
)
This function writes the variable order currently in use in the system in the specified output file. If the option "-reorder" has been used then, then this function exits (if the batch interaction mode is used). The file generated as output can be used as input order file for next computations.

See Also Compile_ReadOrder
Defined in compileOrd.c

static int 
Iwls95CLuster_equal(
  Iwls95Cluster_Info_t * A, 
  Iwls95Cluster_Info_t * B 
)
Checks if two clusters are equal. If it is the case then return 1 else return 0.
Notice that the check is performed only using the "Ti" field of the Iwls95Cluster_Info structure.

Defined in compileIwls95.c

Iwls95Cluster_Info_t * 
Iwls95ClusterInfoAlloc(
    
)
Allocates and initializes memory for Iwls95Cluster_Info struct.

Defined in compileIwls95.c

void 
Iwls95ClusterInfoFree(
  DdManager * dd, 
  Iwls95Cluster_Info_t * CI 
)
Frees the memory allocated for Iwls95Cluster_Info struct.

Defined in compileIwls95.c

static float 
Iwls95ComputeBenefit(
  Iwls95Cluster_Info_t * Ci, 
  Iwls95OptionStruct_t * Option 
)
Computes the benefit function associated to each cluster. The objective function attached with each Ti is Ci = W1*C1 + W2*C2 - W3*C3 + W4*C4 where: W1 = weight attached with variables getting smoothed W2 = weight attached with the support count of the Ti W3 = weight attached with variables getting introduced W4 = weight attached with the max bdd id of the Ti C1 = v_c/w_c C2 = w_c/x_c C3 = y_c/z_c C4 = m_c/M_c v_c = number of ps and pi variables which can be existentially quantified when Ti is multiplied in the product; w_c = number of ps and pi variables in the support of Ti; x_c = total number of ps and pi variables remaining which have not yet been smoothed out; y_c = number of ns variables that would be introduced in the product by multiplying Ti; z_c = total number of ns variables which have not been introduced so far. m_c = value of Max bdd id of Ti M_c = value of Max bdd id across all the Ti's remaining to be multiplied Get the weights from the global option.

Defined in compileIwls95.c

bdd_ptr 
Iwls95ComputeCLustersCube(
  DdManager * dd, 
  node_ptr  set_of_clusters 
)
Given a list of clusters, it computes their set of support.

Defined in 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 
)
Computes some global parameters necessary in the ordering of clusters.

Side Effects The results are returned in x_c, z_c, M_c

See Also Iwls95ComputeClusterInfo Iwls95OptionStruct Iwls95ClusterInfo_struct
Defined in 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
)
Fill all the fields of the list of clusters taken as input.

Side Effects Side effects on Q

Defined in compileIwls95.c

bdd_ptr 
Iwls95Compute_Supp_Q_Ci(
  DdManager * dd, 
  node_ptr  Q, 
  Iwls95Cluster_Info_t * Ci 
)
Computes the set of present an primary input variables that belong to the set of support of cluster Ci, and do not belong to the set of support of each cluster Cj, for j != i and Cj belonging to the set of the not yet ordered clusters. The set Supp_Q_Ci is formally defined as: Supp_Q_Ci = {v in (PS U PI) / v notin S(T_Cj), Cj != Ci, Cj in Q}

Defined in compileIwls95.c

bdd_ptr 
Iwls95CubeAnd(
  DdManager * dd, 
  bdd_ptr  A, 
  bdd_ptr  B 
)
Given the cubes A and B, compute the cube of the variables which are both in A and in B.

Defined in compileIwls95.c

static node_ptr 
Iwls95DeleteCluster(
  node_ptr  source, 
  Iwls95Cluster_Info_t * el 
)
Deletes a given cluster from a list of clusters.

Defined in compileIwls95.c

void 
Iwls95FreeClustersList(
  DdManager * dd, 
  node_ptr  CL 
)
Frees a list of Iwls95Cluster_Info struct.

Defined in compileIwls95.c

Iwls95OptionStruct_t * 
Iwls95GetOptions(
    
)
Gets the necessary options for computing the image and returns in the option structure.

Defined in compileIwls95.c

void 
Iwls95MakeClusters(
  DdManager * dd, 
  node_ptr  RelationList, 
  node_ptr * NewRelationList, 
  Iwls95OptionStruct_t * Options 
)
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 compileIwls95.c

void 
Iwls95MakePartition(
  DdManager * dd, 
  node_ptr  Ti_list, 
  node_ptr * Fwd_Ti_list, 
  node_ptr * Bwd_Ti_list, 
  Iwls95OptionStruct_t * Options, 
  bdd_ptr  PS, 
  bdd_ptr  PI, 
  bdd_ptr  NS 
)
This function performs the initialization of the data structures to perform image computation.
This process consists of the following steps:
  1. Ordering of the clusters given as input accordingly with the heuristic described in IWLS95.
  2. Clustering of the result of previous step accordingly the threshold value stored in the option "image_cluster_size".
  3. Ordering of the result of previous step accordingly with the heuristic described in IWLS95.

Defined in compileIwls95.c

void 
Iwls95OrderClusters(
  DdManager * dd, 
  node_ptr  Unordered, 
  node_ptr * Ordered, 
  bdd_ptr  PS, 
  bdd_ptr  PI, 
  bdd_ptr  NS, 
  Iwls95OptionStruct_t * Options 
)
This function orders the clusters given as input accordingly with the order heuristic described in IWLS95. The ordering is performed according to a cost function attached to each cluster.

Side Effects The result is stored in "Ordered"

See Also Iwls95ClusterInfo_struct Iwls95OptionStruct
Defined in compileIwls95.c

void 
Iwls95PrintClustersInfo(
  FILE * fp, 
  DdManager * dd, 
  node_ptr  ClusterList, 
  node_ptr  var_list 
)
Prints out the information of each cluster, i.e. the size of the cluster in BDD nodes, the set of support of the cluster (distinguishing between current and next state variables), the variable existentially quantified when the current cluster is multiplied in the product. If debugging is activated then also the parameters necessary to compute the cost function are printed out.

Defined in compileIwls95.c

static void 
Iwls95PrintCluster(
  DdManager * dd, 
  Iwls95Cluster_Info_t * Ci 
)
Prints the cluster information.

See Also Iwls95Cluster_Info_t
Defined in compileIwls95.c

int 
Iwls95PrintOption(
  FILE * fp 
)
Prints the option values used in IWLS95 technique for image computation.

Defined in compileIwls95.c

static int 
IwlsCheckMonolithic(
  DdManager * dd, 
  node_ptr  Clist, 
  bdd_ptr  Mon_T 
)
Checks whether the conjunction of the transition relations of all the clusters equals the the monolithic Transition relation.

Defined in compileIwls95.c

double 
add_count_states(
  DdManager * dd, 
  bdd_ptr  fn 
)
Return the number of minterms (i.e. states) represented by a ADD.

Defined in compileEncode.c

static add_ptr 
add_divide(
  DdManager * dd, 
  add_ptr  a, 
  add_ptr  b 
)
Divides two integer ADDs

Defined in compileEval.c

static add_ptr 
add_gt(
  DdManager * dd, 
  add_ptr  a, 
  add_ptr  b 
)
Checks if two integer ADDs are in the less then relation.

Defined in compileEval.c

static add_ptr 
add_lt(
  DdManager * dd, 
  add_ptr  a, 
  add_ptr  b 
)
Checks if two integer ADDs are in the less then relation.

Defined in compileEval.c

static add_ptr 
add_minus(
  DdManager * dd, 
  add_ptr  a, 
  add_ptr  b 
)
Subtracts two integer ADDs.

Defined in compileEval.c

static add_ptr 
add_mod(
  DdManager * dd, 
  add_ptr  a, 
  add_ptr  b 
)
Computes the modulo of the integer division of two integer ADDs.

Defined in compileEval.c

static add_ptr 
add_plus(
  DdManager * dd, 
  add_ptr  a, 
  add_ptr  b 
)
Adds two integer ADDs.

Defined in compileEval.c

add_ptr 
add_shift_backward(
  DdManager * dd, 
  add_ptr  fn 
)
Shift the given set from next variables to current ones.

See Also add_shift_forward
Defined in compileEncode.c

add_ptr 
add_shift_forward(
  DdManager * dd, 
  add_ptr  fn 
)
Shift the given set from current variables to next ones.

See Also add_shift_backward
Defined in compileEncode.c

static add_ptr 
add_times(
  DdManager * dd, 
  add_ptr  a, 
  add_ptr  b 
)
Multiplies two integer ADDs

Defined in compileEval.c

static bdd_ptr 
add_to_bdd_and_abstract_input(
  DdManager * dd, 
  add_ptr  fn 
)
Abstract the input variables from the given BDD.

Defined in compileDisj.c

static add_ptr 
add_union(
  DdManager * dd, 
  add_ptr  a, 
  add_ptr  b 
)
Computes the set union of two set ADDs.

Defined in compileEval.c

double 
bdd_count_states(
  DdManager * dd, 
  add_ptr  fn 
)
Return the number of minterms (i.e. states) represented by a BDD.

Defined in compileEncode.c

bdd_ptr 
bdd_pick_one_state_rand(
  DdManager * dd, 
  bdd_ptr  fn 
)
Extracts a random minterm from a given BDD.

See Also bdd_pick_one_minterm_rand
Defined in compileEncode.c

bdd_ptr 
bdd_pick_one_state(
  DdManager * dd, 
  bdd_ptr  fn 
)
Extracts a minterm from a given BDD.

See Also bdd_pick_one_minterm
Defined in compileEncode.c

bdd_ptr 
bdd_shift_backward(
  DdManager * dd, 
  bdd_ptr  fn 
)
Shift the given set from next variables to current ones.

See Also bdd_shift_forward bdd_permute
Defined in compileEncode.c

bdd_ptr 
bdd_shift_forward(
  DdManager * dd, 
  bdd_ptr  fn 
)
Shift the given set from current variables to next ones.

See Also bdd_shift_backward bdd_permute
Defined in compileEncode.c

static add_ptr 
binary_op(
  DdManager * dd, 
  ADDPFDAA  op, 
  node_ptr  n, 
  int  resflag, 
  int  argflag1, 
  int  argflag2, 
  node_ptr  context 
)
Takes in input the expression 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_model_monolithic(
  node_ptr  trans_expr, 
  node_ptr  invar_expr, 
  node_ptr  procs, 
  add_ptr  assumption 
)
Starting from the trans_expr and procs the monolithic transition relation is computed. If assumption is not NULL, then the resulting transition relation is restricted to the set assumption using the Coudert and Madre algorithm.

See Also Compile_CompileModel
Defined in compileMono.c

static void 
build_proc_selector_recur(
  node_ptr  n, 
  node_ptr  context 
)
Performs the recursive step of build_proc_selector. It also inserts in frame_hash the information necessary to compute the frame axioms.

See Also frame_hash Compile_CompileFrame
Defined in compileUtil.c

void 
build_proc_selector(
  node_ptr  procs_expr 
)
Creates the running ADD variable for each process declared.

Defined in compileUtil.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 node_ptr 
compileCompileModelConjRecur(
  node_ptr  trans_list, 
  node_ptr  n, 
  node_ptr  context, 
  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.

See Also Compile_CompileModelConj
Defined in compileConj.c

static node_ptr 
compileCompileModelIwls95Recur(
  node_ptr  Acc, 
  node_ptr  sexp, 
  node_ptr  cxt, 
  add_ptr  assumption 
)
Given a list of expression, then the corresponding list of ADD is returned.

Side Effects None

See Also Compile_CompileModelDisj Compile_CompileModelIwls95
Defined in compileIwls95.c

void 
compute_fairness_constraints(
  node_ptr  fair_expressions 
)
Computes the set of fairness constraints BDD, in order to use them during the model checking phase.

Defined in compileUtil.c

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 compileUtil.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.
  • If it is an EQDEF, i.e. some kind of equality, the behavior depends on the value of the variable assignment_type, which can be either INIT (assignment of initial states), TRANS (assignment of next variables), and ASSIGN (normal assignments).

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

void 
free_state_vars(
    
)
Free the array necessary to extract minterms from a BDD.

Defined in compileEncode.c

static void 
get_bdd_input_var(
    
)
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(
    
)
Adds a new boolean variable to the DD manager. If it is a state variable, then also the "next" variable is created, and the data structure to perform substitution of "current" and "next" variables is filled in.

See Also get_bdd_input_var
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

void 
init_state_vars(
    
)
Initializes the array necessary to extract minterms from BDDs

Defined in compileEncode.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 * 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 * 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 * 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 {N, N+1, ..., M-1, M}. 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 Compile_FlattenHierarchy 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 * 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 int 
lt_op(
  int  a, 
  int  b 
)
Checks if an integer is less then the other.

Defined in compileEval.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 node_ptr 
make_quantifiers(
  node_ptr  l, 
  add_ptr  vars 
)
Computes the cube to be quantified for each cluster. Given a list of cubes l, and a cube vars, then for each element in the list, the cube difference from it and vars is computed and returned back.

Defined in compileConj.c

void 
make_state_vars(
    
)
Creates the array necessary to extract minterms from a BDD.

Defined in compileEncode.c

static node_ptr 
make_support_list(
  node_ptr  l 
)
Given a list of {A|B}DDs then return the list of the corresponding set of support, i.e. the cube of the {A|B}DD boolean variables the {A|B}DD depends on.

Defined in compileConj.c

static int 
minus_op(
  int  a, 
  int  b 
)
Subtracts two integers

Defined in compileEval.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 int 
plus_op(
  int  a, 
  int  b 
)
Adds two integers

Defined in compileEval.c

void 
print_conj_part_detailed_info(
    
)
Prints the symbolic variables of each partition and each cluster.

Defined in compileConj.c

void 
print_conj_part_info(
    
)
Prints the BDD size of the transitions.

Defined in compileConj.c

void 
print_disj_part_info(
    
)
Prints the BDD size of the partitions.

Defined in compileDisj.c

void 
print_iwls95cp_detailed_info(
    
)

Defined in compileIwls95.c

void 
print_iwls95cp_part_info(
    
)

Defined in compileIwls95.c

void 
print_model_statistic(
    
)
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 or disjunctive partitioning.

Defined in compileUtil.c

void 
print_monolithic_info(
    
)
Prints statistical information on monolithic transition relation.

Defined in compileMono.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, 
  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 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

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

 
(
    
)
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

 
(
    
)
The "running" symbol used to refer the internal variable "running" of processes.

Defined in compileUtil.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

Last updated on 990908 16h51