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

int 
CPCheckQuantificationSchedule(
  DdManager * dd, 
  CPList  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 compileCPUtil.c

CPCluster * 
CPClusterAlloc(
    
)
Allocates and initializes memory for a cluster.

Defined in compileCP.c

CPCluster * 
CPClusterDup(
  CPCluster * oldC 
)
Duplicates a cluster allocating necessary memory. Infos are not duplicated.

Defined in compileCP.c

int 
CPClusterEqual(
  CPCluster * A, 
  CPCluster * 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 CPCluster structures.

Defined in compileCP.c

void 
CPClusterFree(
  DdManager * dd, 
  CPCluster * CI 
)
Frees the memory allocated for CPCluster struct. It doesn't free the Info data pointend by the Info field.

Defined in compileCP.c

bdd_ptr 
CPClusterGetEi(
  CPCluster * CI 
)
Returns a pointer to the variables to be quantified respect to the transition relation inside the cluster

Defined in compileCP.c

void * 
CPClusterGetInfo(
  CPCluster * CI 
)
Returns a pointer to the (optional) info of the cluster

Defined in compileCP.c

bdd_ptr 
CPClusterGetTi(
  CPCluster * CI 
)
Returns a pointer to the transition inside the cluster

Defined in compileCP.c

void 
CPClusterSetEi(
  CPCluster * CI, 
  bdd_ptr  newEi 
)
Sets the variables to be quantified inside the cluster

Defined in compileCP.c

void 
CPClusterSetInfo(
  CPCluster * CI, 
  void * newInfo 
)
Sets the (optional) info inside the cluster

Defined in compileCP.c

void 
CPClusterSetTi(
  CPCluster * CI, 
  bdd_ptr  newTi 
)
Sets the transition inside the cluster

Defined in compileCP.c

CPList 
CPListAddOneCluster(
  CPCluster * Ci, 
  CPList  CL, 
  bdd_ptr  vars 
)
Adds one cluster and compute the variables to be quantified

Defined in compileCP.c

CPList 
CPListAlloc(
  CPCluster * el 
)
Creates a list with a given cluster

Defined in compileCP.c

CPList 
CPListBuildBasicRecur(
  CPList  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 compileCP.c

CPList 
CPListBuildElementaryBDDList(
  node_ptr  var_list, 
  add_ptr  assumption 
)
Builds a clustered transition relation given variables and assumptions. You obtain a list of small transition relations, one item for each variable

Defined in compileCP.c

bdd_ptr 
CPListBuildMonolithicBDDFromCPlist(
  CPList  CL 
)
Starting from the a partitioned transtion relation it builds the BDD corresponding to the monolithic transition relation.

Defined in compileCP.c

bdd_ptr 
CPListBuildMonolithicBDD(
  node_ptr  list_variables, 
  bdd_ptr  assumption 
)
Starting from the the list of variables builds the corresponding transition relation BDD. The result is restricted to the set assumption using the Coudert and Madre algorithm.

Defined in compileCP.c

CPList 
CPListBuildMonolithic(
  node_ptr  list_variables, 
  bdd_ptr  assumption 
)
Builds the monolithic transition relation BDD in a CPList. Wrapper of CPListBuildMonolithicBDD().

Defined in compileCP.c

bdd_ptr 
CPListBuildScheduleRecur(
  CPList  l, 
  bdd_ptr  vars 
)
Computes recursively the schedule for the given list of clusters

Defined in compileCP.c

void 
CPListBuildSchedule(
  CPList  CL, 
  bdd_ptr  vars 
)
Builds the quantification schedule of a given cluster list

Defined in compileCP.c

void 
CPListBuildThreshold(
  DdManager * dd, 
  CPList  RelationList, 
  CPList * 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 compileCP.c

int 
CPListCheckComparing(
  DdManager * dd, 
  CPList  CL1, 
  CPList  CL2 
)
Compare two transition relations computing the monolithic equivalents and comparing them.

Defined in compileCP.c

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

Defined in compileCP.c

CPList 
CPListCons(
  CPCluster * C, 
  CPList  CL 
)
Adds a cluster on top of a given list

Defined in compileCP.c

CPList 
CPListDeleteCluster(
  CPList  source, 
  CPCluster * el 
)
Deletes every occurrence of a cluster in a list

Defined in compileCP.c

CPList 
CPListDup(
  CPList  CL 
)
Duplicates a given list of clusters and each cluster. The Info field of each cluster is not duplicated, but only initialized.

Defined in compileCP.c

void 
CPListFree(
  DdManager * dd, 
  CPList  CL 
)
Frees the list of clusters and all its elements. It doesn't free the Info field of the cluster.

Defined in compileCP.c

CPCluster * 
CPListGetItem(
  CPList  CL 
)
Returns the cluster held by the current position of the list

Defined in compileCP.c

int 
CPListIsEmpty(
  CPList  CL 
)
Tests if a list is empty.

Defined in compileCP.c

int 
CPListIsNotEmpty(
  CPList  CL 
)
Tests if a list is empty.

Defined in compileCP.c

int 
CPListLength(
  CPList  CL 
)
Returns the number of items in the list

Defined in compileCP.c

CPList 
CPListNext(
  CPList  CL 
)
Returns the next position in the list

Defined in compileCP.c

void 
CPListPrintClustersInfo(
  FILE * fp, 
  DdManager * dd, 
  CPList  ClusterList, 
  node_ptr  var_list 
)
Prints detailed information of a given transition relation. This is an old version still used.

Defined in compileCP.c

void 
CPListPrintDetailedInfo(
  FILE * file, 
  CPList  CL 
)
Prints detailed information of a given transition relation

Defined in compileCP.c

void 
CPListPrintInfo(
  FILE * file, 
  CPList  CL 
)
Prints size of each cluster in a given clustered transition relation

Defined in compileCP.c

CPList 
CPListReverse(
  CPList  CL 
)
Reverses a given list

Side Effects The argument is modified

Defined in compileCP.c

CPTrans_Ptr 
CPTransAlloc(
    
)
Allocates memory for a conjunctive partitioning transition

Defined in compileCP.c

CPTrans_Ptr 
CPTransDup(
  CPTrans_Ptr  c 
)
Duplicates a CPTrans and all data inside, but not the info of each cluster

Defined in compileCP.c

void 
CPTransFree(
  CPTrans_Ptr  c 
)
Frees a CPTrans and all data inside, but not the Info of single clusters.

Defined in compileCP.c

CPList 
CPTransGetBackward(
  CPTrans_Ptr  c 
)
Returns the backward transition relation list

Defined in compileCP.c

CPList 
CPTransGetForward(
  CPTrans_Ptr  c 
)
Returns the forward transition relation list

Defined in compileCP.c

void 
CPTransPrintDetailedInfo(
  FILE * file, 
  CPTrans_Ptr  c 
)
Prints short detailed associated to a CPTrans

Defined in compileCP.c

void 
CPTransPrintInfo(
  FILE * file, 
  CPTrans_Ptr  c 
)
Prints info about the size of each cluster in forward/backward transition relation

Defined in compileCP.c

void 
CPTransSetBackward(
  CPTrans_Ptr  c, 
  CPList  b 
)
Sets the backward transition relation

Defined in compileCP.c

void 
CPTransSetForward(
  CPTrans_Ptr  c, 
  CPList  f 
)
Sets the forward transition relation

Defined in compileCP.c

int 
CommandBuildBooleanModel(
  int  argc, 
  char ** argv 
)
Compiles the flattened hierarchy into boolean SEXP

Defined in compileCmd.c

int 
CommandBuildFlatModel(
  int  argc, 
  char ** argv 
)
Compiles the flattened hierarchy into SEXP

Defined in compileCmd.c

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

Defined in compileCmd.c

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

Defined in compileCmd.c

int 
CommandCheckWff(
  int  argc, 
  char ** argv 
)
Checks formulas potential errors.

Defined in compileCmd.c

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

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 
CommandGoBmc(
  int  argc, 
  char ** argv 
)
Implements the go_bmc command

Defined in compileCmd.c

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

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 
CommandShowVars(
  int  argc, 
  char ** argv 
)
Shows model's symbolic variables and their values

Defined in compileCmd.c

int 
CommandWriteModelFlatBool(
  int  argc, 
  char ** argv 
)
Writes a flat and boolean model of a given SMV file

Defined in compileCmd.c

int 
CommandWriteModelFlat(
  int  argc, 
  char ** argv 
)
Writes the currently loaded SMV model in the specified file, after having flattened it

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  name, 
  node_ptr  range, 
  int  curlevel, 
  int  num, 
  boolean  is_input, 
  boolean  flag 
)
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

bdd_ptr 
Compile_BuildInitBdd(
  node_ptr  list_variables 
)
This function evaluates all the init statements corresponding to the variables passed as argument. Moreover, the number of states and the number of BDD nodes of the global initial set are printed out.

Defined in compileUtil.c

bdd_ptr 
Compile_BuildInvarBdd(
  node_ptr  list_variables, 
  add_ptr  assumption 
)
This function evaluates all the model invariant corresponding to the variables passed as argument. The result is restricted to the set assumption using the Coudert and Madre algorithm. Moreover the number of BDD nodes of the global set of invariant are printed out.

Defined in compileUtil.c

CPTrans_Ptr 
Compile_BuildModelIwls95CP(
  node_ptr  list_variables, 
  Iwls95OptionStruct_t * Options, 
  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_BuildModelMonolithic Compile_BuildModelThreshold
Defined in compileIwls95.c

CPTrans_Ptr 
Compile_BuildModelMonolithic(
  node_ptr  list_variables, 
  bdd_ptr  assumption 
)
Starting from the the list of variables builds the corresponding transition relation. The result is restricted to the set assumption using the Coudert and Madre algorithm.

See Also Compile_CompileModel
Defined in compileMono.c

CPTrans_Ptr 
Compile_BuildModelThreshold(
  node_ptr  list_variables, 
  int  threshold, 
  bdd_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_BuildModelMono Compile_BuildModelIwls95
Defined in compileThreshold.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 num_of_state_variables are modified.

See Also Compile_EncodeVar Compile_ReadOrder dd_new_var_block
Defined in compileUtil.c

CPTrans_Ptr 
Compile_CPAddClusterAndFillSchedule(
  CPTrans_Ptr  trans, 
  bdd_ptr  tableau_bdd 
)
Add the LTL tableau as a new BDD cluster in the transition relation.

Defined in compileCPUtil.c

void 
Compile_CheckProgram(
  node_ptr  procs, 
  node_ptr  spec_expr, 
  node_ptr  ltlspec_expr, 
  node_ptr  invar_expr, 
  node_ptr  justice_expr, 
  node_ptr  compassion_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

int 
Compile_CheckWff(
  node_ptr  wff, 
  node_ptr  context 
)
It analizes a formula on the basis of its arguments and operators and returns 0 if the formula is ok, 1 otherwise

See Also check_wff_recur
Defined in compileCheckWff.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, 
  boolean  is_input, 
  boolean  flag 
)
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. flag is used to indicate if the created variables have to be inserted in the array used to extract complete minterms from a BDD.

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 * 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 * justice, the list of JUSTICE actually recognized
  node_ptr * compassion, the list of COMPASSION 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, ...)...
Moreover all these informations are flattened.

Side Effects None

See Also compileFlattenHierarchy
Defined in compileFlatten.c

node_ptr 
Compile_FlattenSexpExpandDefine(
  node_ptr  sexp, 
  node_ptr  context 
)
Flattens an expression and expands defined symbols.

See Also Flatten_GetDefinition
Defined in compileFlatten.c

node_ptr 
Compile_FlattenSexp(
  node_ptr  sexp, 
  node_ptr  context 
)
Builds the flattened version of an expression. It does not expand defined symbols with the corresponding body.

See Also Flatten_GetDefinition
Defined in 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 * justice, the list of JUSTICE actually recognized
  node_ptr * compassion, the list of COMPASSION actually recognized
  node_ptr * procs, the list of processes actually recognized
  node_ptr  actual the actual module arguments
)
Traverses the module tableau and extracts the information needed to compile the automaton. The tableau 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, ...)...
Moreover all these informations are flattened.

Side Effects None

See Also Compile_FlattenHierarchy compileFlattenHierarchy
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_InitializeBuildModel(
    
)
Checks correctness of the NuSMV progrma if not yet checked. Initializes the build model if not yet initialized.

Side Effects required

See Also optional
Defined in compileUtil.c

void 
Compile_InitializeSexpBuildModel(
  node_ptr  all_variables 
)
optional

Side Effects required

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

int 
Compile_WriteFlattenBool(
  FILE * out, 
  Fsm_SexpPtr  fsm, 
  cmp_struct_ptr  s 
)
[Prints on the specified file the flatten version of an SMV model.

Defined in compileWriteBool.c

int 
Compile_WriteFlatten(
  FILE * out, 
  cmp_struct_ptr  s 
)
[Prints on the specified file the flatten version of an SMV model.

Defined in compileWriteFlat.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. If the specified output file is an empty string ("" or NULL, see util_is_string_null) output is redirected to stdout.

See Also Compile_ReadOrder
Defined in compileOrd.c

Set_t 
ComputeCOI(
  Set_t  base 
)
Computes the COI of a given set of variables.

Defined in compileCone.c

static node_ptr 
Flatten_FlattenSexpRecur(
  node_ptr  sexp, 
  node_ptr  context 
)
Recursive function for flattenig a sexp.

See Also Compile_FlattenSexp Compile_FlattenSexpExpandDefine
Defined in compileFlatten.c

static node_ptr 
Flatten_GetDefinition(
  node_ptr  atom 
)
Gets the flattened version of an atom. If the atom is a define then it is expanded. If the definition mode is set to "expand", then the expanded flattened version is returned, otherwise, the atom is returned.

Side Effects The flatten_def_hash is modified in order to memoize previously computed definition expansion.

Defined in compileFlatten.c

Set_t 
Formula_GetDependencies(
  node_ptr  formula, 
  node_ptr  context 
)
The set of dependencies of a given formula are computed. A traversal of the formula is performed. Each time a variable is encountered, it is added to the so far computed set. When a formula depends on a next variable, then the corresponding current variable is added to the set. When an atom is found a call to formulaGetDefinitionDependencies is performed to compute the dependencies.

See Also formulaGetDefinitionDependencies
Defined in compileCone.c

Set_t 
Formulae_GetDependencies(
  node_ptr  formula, 
  node_ptr  justice, 
  node_ptr  compassion 
)
Given a formula and a list of fairness constraints, the set of variables occurring in them is computed.

Defined in compileCone.c

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

Defined in compileIwls95.c

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

Defined in compileIwls95.c

static float 
Iwls95ComputeBenefit(
  CPClusterInfoIwls95 * 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

static void 
Iwls95ComputeClusterInfoAux(
  DdManager * dd, 
  CPList  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

CPList 
Iwls95ComputeClusterInfo(
  DdManager * dd, The DD manager
  CPList  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 
Iwls95ComputeClustersCube(
  DdManager * dd, 
  CPList  set_of_clusters 
)
Given a list of clusters, it computes their set of support.

Defined in compileIwls95.c

bdd_ptr 
Iwls95Compute_Supp_Q_Ci(
  DdManager * dd, 
  CPList  Q, 
  CPCluster * 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

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

static void 
Iwls95MakePartition(
  DdManager * dd, 
  CPList  Ti_list, 
  CPList * new_Ti_list, 
  Iwls95OptionStruct_t * Options, 
  bdd_ptr  PS, 
  bdd_ptr  PI, 
  bdd_ptr  NS 
)
This function builds 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, 
  CPList  Unordered, 
  CPList * 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. It also removes further occurence of same clusters.

Side Effects The result is stored in "Ordered"

See Also Iwls95ClusterInfo_struct Iwls95OptionStruct
Defined in compileIwls95.c

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

Defined in compileIwls95.c

static node_ptr 
add2bexpr_recur(
  DdManager * dd, 
  add_ptr  bool_add, 
  boolean  in_next, 
  boolean  allow_nondet, 
  st_table * lc 
)
Auxiliary function for add2bexpr.

Side Effects A new boolean variable can be introduced.

See Also add2bexpr range_check
Defined in compileBEval.c

static node_ptr 
add2bexpr(
  add_ptr  bool_add, 
  boolean  in_next, 
  boolean  allow_nondet 
)
Takes an ADD with leaves 0, 1, or {0,1}. The case of {0,1} leaves 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

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 add_ptr 
add_union(
  DdManager * dd, 
  add_ptr  a, 
  add_ptr  b 
)
Computes the set union of two set ADDs.

Defined in compileEval.c

void 
add_var_to_minterm_vars(
  int  vn 
)
Adds a variable to the sarray necessary to extract minterms from a BDD.

Defined in compileEncode.c

static int 
affinity_move_clusters(
  CPList  List, 
  CPList * NewRelationList, 
  int  threshold, 
  node_ptr * L, 
  heap  H 
)
Copy over threshold clusters in result list or in support list & heap. It doesn't modify the input list.

Defined in compileAffinity.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_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 void 
compileBddFsmPrintInfo(
  FILE * file, 
  Fsm_BddPtr  fsm, 
  CPTrans_Ptr  c 
)
optional

Side Effects required

See Also optional
Defined in compileUtil.c

void 
compileCPCheckPartitionedTransition(
  CPTrans_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 compileCPUtil.c

void 
compileCPMakeAffinityClusters(
  DdManager * dd, 
  CPList  RelationList, 
  CPList * NewRelationList, 
  int  threshold 
)
OPTIMIZED affinity clustering

Defined in compileAffinity.c

static void 
compileFlattenConstantSexpCheck(
  node_ptr  expr, 
  int  type 
)
optional

Side Effects required

See Also optional
Defined in compileFlatten.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 * justice, the list of JUSTICE actually recognized
  node_ptr * compassion, the list of COMPASSION 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 
compileFlattenSexpModelAux(
  node_ptr  expr, 
  int  type 
)
optional

Side Effects required

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

void 
compilePrintBddModelStatistic(
  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

double 
compute_bdd_affinity(
  bdd_ptr  a, 
  bdd_ptr  b 
)
Compute the Affinity between two BDD clusters as suggested by Moon, Hachtel, Somenzi in BBT paper. Affinity is the ratio between the number of shared variables and the number of the union of all variables (intersection/union)

Defined in compileAffinity.c

double 
compute_bdd_affinity(
  bdd_ptr  a, 
  bdd_ptr  b 
)
Compute the Affinity between two BDDs. This is an alternative definition to the one suggested by by Moon, Hachtel, Somenzi in BBT paper.

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

add_ptr 
eval_constant(
  node_ptr  expr, 
  node_ptr  context 
)
Evaluate a constant expression. If the expression does not evaluate to a constant, then an internal error is generated.

See Also eval eval_num
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 * justice, 
  node_ptr * compassion, 
  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 * justice, 
  node_ptr * compassion, 
  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 * justice, 
  node_ptr * compassion, 
  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 * justice, 
  node_ptr * compassion, 
  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 * 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_false(
    
)
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

static void 
print_io_atom_stack_assign(
  FILE * fd 
)

Defined in compileCheck.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_states(
  bdd_ptr  states 
)
Prints the states represented by a bdd.

Side Effects print_hash is reset.

See Also print_reachable_states print_state
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 char * 
type_to_string(
  int  type 
)
optional

See Also optional
Defined in compileFlatten.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_pair(
  FILE * out, 
  node_ptr  l, 
  char * s 
)
Writes a list of flattened expression pairs prefixed by a given string in SMV format on a file.

Defined in compileWriteBool.c

static int 
write_flatten_expr_pair(
  FILE * out, 
  node_ptr  l, 
  char * s 
)
Writes a list of flattened expression pairs prefixed by a given string 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

 
(
    
)
Frees a CPTrans and all data inside and the Info of each cluster given a proper function

Defined in compileCP.c

 
(
    
)
Frees the memory allocated for CPCluster struct and the Info data, given a method.

Defined in compileCP.c

 
(
    
)
Frees the info of a cluster given a proper fuction

Defined in compileCP.c

 
(
    
)
Frees the list of clusters and all its elements, Info field too, given a proper function.

Defined in compileCP.c

 
(
    
)
Frees the only Info field of each cluster in the list given a proper function, but not the cluster, nor the list.

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

 
(
    
)
The empty CP List

Side Effects None

Defined in compile.h

 
(
    
)
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 1021107 13h03