SymbTable Struct Reference

The system wide symbol table interface. More...

#include <SymbTable.h>

Related Functions

(Note that these are not member functions.)



void SymbTable_add_trigger (const SymbTable_ptr self, SymbTableTriggerFun trigger, SymbTableTriggerAction action, void *arg1, boolean must_free_arg)
 Adds a trigger to the symbol table.
SymbTable_ptr SymbTable_anonymize (const SymbTable_ptr self, Set_t blacklist, NodeAnonymizerBase_ptr anonymizer)
boolean SymbTable_contains_array_variables (const SymbTable_ptr self)
 Checks whether the Symbol Table contains array variables.
boolean SymbTable_contains_enum_variables (const SymbTable_ptr self)
 Checks whether the Symbol Table contains enum variables.
boolean SymbTable_contains_functions (const SymbTable_ptr self)
 Checks whether the Symbol Table contains functions.
boolean SymbTable_contains_infinite_precision_variables (const SymbTable_ptr self)
 Checks whether the Symbol Table contains infinite precision variables.
boolean SymbTable_contains_word_variables (const SymbTable_ptr self)
 Checks whether the Symbol Table contains word variables.
SymbTable_ptr SymbTable_copy (SymbTable_ptr self, Set_t blacklist)
 Create a new SymbolTable which contains the same info as the given one except the specified symbols in blacklist, in the same environment.
SymbTable_ptr SymbTable_create (NuSMVEnv_ptr env)
 Class constructor.
SymbLayer_ptr SymbTable_create_layer (SymbTable_ptr self, const char *layer_name, const LayerInsertPolicy ins_policy)
 Creates and adds a new layer.
void SymbTable_create_layer_class (SymbTable_ptr self, const char *class_name)
 Declares a new class of layers.
SymbLayer_ptr SymbTable_define_get_layer (SymbTable_ptr self, node_ptr name)
 Returns the layer a DEFINE is defined in.
void SymbTable_destroy (SymbTable_ptr self)
 Class destructor.
void SymbTable_foreach (const SymbTable_ptr self, unsigned int mask, SymbTableForeachFun fun, void *arg)
 Executes the given function over each symbol that satisfies the given symbol mask.
SymbLayer_ptr SymbTable_function_get_layer (SymbTable_ptr self, node_ptr name)
 Returns the layer a NFunction is defined in.
void SymbTable_gen_iter (const SymbTable_ptr self, SymbTableIter *iter, unsigned int mask)
 Initializes the given iterator with the given mask.
node_ptr SymbTable_get_actual_parameter (const SymbTable_ptr self, const node_ptr name)
 Returns the actual param of the given formal parameter.
node_ptr SymbTable_get_actual_parameter_context (const SymbTable_ptr self, const node_ptr name)
 Returns the context of the actual parameter associated with the given formal one.
node_ptr SymbTable_get_array_define_body (const SymbTable_ptr self, const node_ptr name)
 Returns the body of the given array define name.
node_ptr SymbTable_get_array_define_context (const SymbTable_ptr self, const node_ptr name)
 Returns the context of the given array define name.
node_ptr SymbTable_get_array_define_flatten_body (const SymbTable_ptr self, const node_ptr name)
 Returns the flattened body of the given array define name.
int SymbTable_get_array_defines_num (const SymbTable_ptr self)
 Returns the number of all declared array define.
node_ptr SymbTable_get_array_lower_bound_variable (const SymbTable_ptr self, node_ptr array)
 Return the variable corresponding to lower bound of array.
node_ptr SymbTable_get_array_upper_bound_variable (const SymbTable_ptr self, node_ptr array)
 Return the variable corresponding to upper bound of array.
array_tSymbTable_get_class_layer_names (SymbTable_ptr self, const char *class_name)
 Returns an array of layer names that belong to the given class name. If class_name is NULL, default class name will be taken (must be set before).
const char * SymbTable_get_class_of_layer (const SymbTable_ptr self, const char *layer_name)
 Returns the name of the class in which the given layer is declared or NULL if there is no such a class.
int SymbTable_get_constants_num (const SymbTable_ptr self)
 Returns the number of all declared constants.
const char * SymbTable_get_default_layers_class_name (const SymbTable_ptr self)
 Returns the default layers class name that has been previously set. The default layers class name is the class of layers that is taken when the system needs a default set of layers to work with. Typically the default class is the class of model layers, that is used for example when dumping the hierarchy by command write_bool_model.
node_ptr SymbTable_get_define_body (const SymbTable_ptr self, const node_ptr name)
 Returns the body of the given DEFINE.
node_ptr SymbTable_get_define_context (const SymbTable_ptr self, const node_ptr name)
 Returns the context of the given DEFINE name.
node_ptr SymbTable_get_define_flatten_body (const SymbTable_ptr self, const node_ptr name)
 Returns the flattenized body of the given define.
int SymbTable_get_defines_num (const SymbTable_ptr self)
 Returns the number of all declared defines.
node_ptr SymbTable_get_determinization_var_name (const SymbTable_ptr self)
 Returns a valid name for a new determinization variable.
node_ptr SymbTable_get_flatten_actual_parameter (const SymbTable_ptr self, const node_ptr name)
 Returns the flattenized actual parameter of the given formal parameter.
node_ptr SymbTable_get_fresh_symbol_name (const SymbTable_ptr self, const char *prefix)
 Given a prefix, returns a fresh symbol name. This function NEVER returns the same symbol twice and NEVER returns a declared name.
int SymbTable_get_frozen_vars_num (const SymbTable_ptr self)
 Returns the number of all declared frozen variables.
NFunction_ptr SymbTable_get_function (const SymbTable_ptr self, const node_ptr name)
 Returns the NFunction with the given name.
node_ptr SymbTable_get_function_context (const SymbTable_ptr self, const node_ptr name)
 Returns the context of the NFunction with the given name.
SymbType_ptr SymbTable_get_function_type (const SymbTable_ptr self, const node_ptr name)
 Returns the type of a given function.
int SymbTable_get_functions_num (const SymbTable_ptr self)
 Returns the number of all NFunctions.
hash_ptr SymbTable_get_handled_hash_ptr (SymbTable_ptr self, const char *key, ST_PFICPCP compare_func, ST_PFICPI hash_func, ST_PFSR destroy_func, SymbTableTriggerFun add_action, SymbTableTriggerFun remove_action, SymbTableTriggerFun redeclare_action)
 Retrieves a special hash_ptr instance handled by the SymbTable.
int SymbTable_get_input_vars_num (const SymbTable_ptr self)
 Returns the number of all declared input variables.
SymbLayer_ptr SymbTable_get_layer (const SymbTable_ptr self, const char *layer_name)
NodeList_ptr SymbTable_get_layers (const SymbTable_ptr self)
 Returns the list of owned layers.
NodeList_ptr SymbTable_get_layers_i_symbols (SymbTable_ptr self, const array_t *layer_names)
 Returns the list of input symbols that belong to the given layers.
NodeList_ptr SymbTable_get_layers_i_vars (SymbTable_ptr self, const array_t *layer_names)
 Returns the list of input variables that belong to the given layers.
NodeList_ptr SymbTable_get_layers_sf_i_symbols (SymbTable_ptr self, const array_t *layer_names)
 Returns the list of state and input symbols that belong to the given layers, meaning those DEFINES whose body contain both state (or frozen) and input variables. This methods does _NOT_ return the state symbols plus the input symbols.
NodeList_ptr SymbTable_get_layers_sf_i_vars (SymbTable_ptr self, const array_t *layer_names)
 Returns the list of variables that belong to the given layers.
NodeList_ptr SymbTable_get_layers_sf_symbols (SymbTable_ptr self, const array_t *layer_names)
 Returns the list of state and frozen symbols that belong to the given layers.
NodeList_ptr SymbTable_get_layers_sf_vars (SymbTable_ptr self, const array_t *layer_names)
 Returns the list of state and frozen variables that belong to the given layers.
int SymbTable_get_parameters_num (const SymbTable_ptr self)
 Returns the number of all parameters.
int SymbTable_get_state_vars_num (const SymbTable_ptr self)
 Returns the number of all declared state variables.
SymbCategory SymbTable_get_symbol_category (const SymbTable_ptr self, const node_ptr name)
 This function returns the category of an identifier.
node_ptr SymbTable_get_symbol_from_str (const SymbTable_ptr self, const char *symbol_str)
 Given a string name, constructs a node and returns it, using the internal node and string managers.
SymbType_ptr SymbTable_get_symbol_type (const SymbTable_ptr self, const node_ptr name)
 Returns the type of a given symbol.
int SymbTable_get_symbols_num (const SymbTable_ptr self)
 Returns the number of all symbols.
TypeChecker_ptr SymbTable_get_type_checker (const SymbTable_ptr self)
 Returns the internally stored type checker.
Set_t SymbTable_get_type_tags (const SymbTable_ptr self)
 Returns a set of type tags of all variables, variable arrays and functions contained in the symbol table.
node_ptr SymbTable_get_var_array_from_element (const SymbTable_ptr self, node_ptr element)
 Return the variable array corresponding to element.
SymbType_ptr SymbTable_get_var_type (const SymbTable_ptr self, const node_ptr name)
 Returns the type of a given variable.
SymbType_ptr SymbTable_get_variable_array_type (const SymbTable_ptr self, const node_ptr name)
 Returns the type of the given var array.
int SymbTable_get_vars_num (const SymbTable_ptr self)
 Returns the number of all declared variables.
boolean SymbTable_has_layer (const SymbTable_ptr self, const char *layer_name)
 True if layer_name belongs to self.
boolean SymbTable_is_layer_in_class (SymbTable_ptr self, const char *layer_name, const char *class_name)
 Returns true if given layer name belongs to the given class.
boolean SymbTable_is_symbol_array_define (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a declared array define.
boolean SymbTable_is_symbol_array_var_element (const SymbTable_ptr symb_table, const node_ptr name)
 Returns true iff this name is sub-element of a variable array.
boolean SymbTable_is_symbol_bool_var (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a variable of enum type with the values 0 and 1 (boolean).
boolean SymbTable_is_symbol_constant (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a declared constant.
boolean SymbTable_is_symbol_declared (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is declared.
boolean SymbTable_is_symbol_define (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a declared DEFINE.
boolean SymbTable_is_symbol_frozen_var (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a frozen variable.
boolean SymbTable_is_symbol_frozen_var_array (const SymbTable_ptr self, node_ptr array)
 True if the variables contained in array are frozen vars.
boolean SymbTable_is_symbol_function (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a declared NFunction.
boolean SymbTable_is_symbol_input_var (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is an input variable.
boolean SymbTable_is_symbol_input_var_array (const SymbTable_ptr self, node_ptr array)
 True if the variables contained in array are input vars.
boolean SymbTable_is_symbol_parameter (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a declared parameter.
boolean SymbTable_is_symbol_state_frozen_var (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a frozen or a state variable.
boolean SymbTable_is_symbol_state_var (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a state variable.
boolean SymbTable_is_symbol_state_var_array (const SymbTable_ptr self, node_ptr array)
 True if the variables contained in array are state vars.
boolean SymbTable_is_symbol_var (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is either a state, frozen or an input variable.
boolean SymbTable_is_symbol_variable_array (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given symbol is a declared variable array.
boolean SymbTable_is_var_finite (const SymbTable_ptr self, const node_ptr name)
 Returns true if the given variable has a finite domain.
unsigned int SymbTable_iter_count (const SymbTable_ptr self, SymbTableIter iter)
 Counts the elements of the iterator.
boolean SymbTable_iter_filter_i_symbols (const SymbTable_ptr self, const node_ptr sym, void *arg)
 Default iterator filter: Input symbols.
boolean SymbTable_iter_filter_out_var_array_elems (const SymbTable_ptr self, const node_ptr sym, void *arg)
 Default iterator filter: skip var array elements.
boolean SymbTable_iter_filter_sf_i_symbols (const SymbTable_ptr self, const node_ptr sym, void *arg)
 Default iterator filter: State, Frozen and Input symbols.
boolean SymbTable_iter_filter_sf_symbols (const SymbTable_ptr self, const node_ptr sym, void *arg)
 Default iterator filter: State, Frozen symbols.
node_ptr SymbTable_iter_get_symbol (const SymbTable_ptr self, const SymbTableIter *iter)
 Gets the symbol pointed by the given iterator.
boolean SymbTable_iter_is_end (const SymbTable_ptr self, const SymbTableIter *iter)
 Checks if the iterator is at it's end.
void SymbTable_iter_next (const SymbTable_ptr self, SymbTableIter *iter)
 Moves the iterator to the next valid symbol.
void SymbTable_iter_set_filter (const SymbTable_ptr self, SymbTableIter *iter, SymbTableIterFilterFun fun, void *arg)
 Sets the filter to be used by the iterator.
NodeList_ptr SymbTable_iter_to_list (const SymbTable_ptr self, SymbTableIter iter)
 Creates a set starting from the iterator.
Set_t SymbTable_iter_to_set (const SymbTable_ptr self, SymbTableIter iter)
 Creates a set starting from the iterator.
void SymbTable_layer_add_to_class (SymbTable_ptr self, const char *layer_name, const char *class_name)
 Adds a given layer (that must exist into self already) to a class of layers. Classes are used to group layers into possibly overlapping sets. For example the class of layers containing the set of symbols that belongs to the SMV model. If class_name is NULL, the default class name will be taken (must be set before).
boolean SymbTable_layer_class_exists (SymbTable_ptr self, const char *class_name)
 Checks if a class of layers exists.
void SymbTable_layer_remove_from_class (SymbTable_ptr self, const char *layer_name, const char *class_name)
 Removes a given layer (that must exist into self already) from a given class of layers. If class_name is NULL, the default class is taken (must be set before).
boolean SymbTable_list_contains_input_var (const SymbTable_ptr self, const NodeList_ptr var_list)
 Returns true if var_list contains at least one input variable, false otherwise.
boolean SymbTable_list_contains_state_frozen_var (const SymbTable_ptr self, const NodeList_ptr var_list)
 Returns true if var_list contains at least one state or frozen variable, false otherwise.
boolean SymbTable_list_contains_undef_var (const SymbTable_ptr self, const NodeList_ptr var_list)
 Returns true if the given symbols list contains one or more undeclared variable names, false otherwise.
void SymbTable_remove_layer (SymbTable_ptr self, SymbLayer_ptr layer)
 Removes and destroys a layer.
void SymbTable_remove_trigger (const SymbTable_ptr self, SymbTableTriggerFun trigger, SymbTableTriggerAction action)
 Removes a trigger from the Symbol Table.
void SymbTable_rename_layer (const SymbTable_ptr self, const char *layer_name, const char *new_name)
 Renames an existing layer.
ResolveSymbol_ptr SymbTable_resolve_symbol (SymbTable_ptr self, node_ptr expr, node_ptr context)
void SymbTable_set_default_layers_class_name (SymbTable_ptr self, const char *class_name)
char * SymbTable_sprint_category (SymbTable_ptr self, node_ptr symbol)
 Return the string version of the SymbCategory of symbol Returned string must NOT be freed.
SymbLayer_ptr SymbTable_symbol_get_layer (SymbTable_ptr self, node_ptr name)
 Returns the layer a symbol is defined in.
SymbLayer_ptr SymbTable_variable_get_layer (SymbTable_ptr self, node_ptr name)
 Returns the layer a variable is defined in.

Detailed Description

The system wide symbol table interface.

Author:
Roberto Cavada
Todo:
: Missing description

SymbTable class accessors


Friends And Related Function Documentation

void SymbTable_add_trigger ( const SymbTable_ptr  self,
SymbTableTriggerFun  trigger,
SymbTableTriggerAction  action,
void *  arg1,
boolean  must_free_arg 
) [related]

Adds a trigger to the symbol table.

Adds a trigger to the symbol table. "arg" and "arg2" are the arguments that will be passed to function "trigger" when invoked.

If the trigger is already registered (same function and same action), it is not added again

The "action" parameter determines when "trigger" is triggered. The possibilities are:

ST_TRIGGER_SYMBOL_ADD: Triggered when a symbol is added. When the trigger is called, all informations about the symbol are already available (e.g. SymbType).

ST_TRIGGER_SYMBOL_REMOVE: Triggered when a symbol is removed. This may happen when removing a layer from the symbol table, or when removing a variable from a layer. All informations about the symbol are still available when the trigger is invoked

ST_TRIGGER_SYMBOL_REDECLARE: Triggered when a symbol that had been removed from the symbol table, or a from a layer, is redeclared with the same name. All informations about the new symbol are available, while informations about the old symbol are not.

Param must_free_arg controls if given argument must be freed upon trigger destruction.

See also:
SymbTable_remove_trigger
SymbTable_ptr SymbTable_anonymize ( const SymbTable_ptr  self,
Set_t  blacklist,
NodeAnonymizerBase_ptr  anonymizer 
) [related]
Todo:
Anonymize a symb table
Todo:
input symbol table is copied
boolean SymbTable_contains_array_variables ( const SymbTable_ptr  self  )  [related]

Checks whether the Symbol Table contains array variables.

Checks whether the Symbol Table contains array variables

boolean SymbTable_contains_enum_variables ( const SymbTable_ptr  self  )  [related]

Checks whether the Symbol Table contains enum variables.

Checks whether the Symbol Table contains enum variables

boolean SymbTable_contains_functions ( const SymbTable_ptr  self  )  [related]

Checks whether the Symbol Table contains functions.

Checks whether the Symbol Table contains functions

boolean SymbTable_contains_infinite_precision_variables ( const SymbTable_ptr  self  )  [related]

Checks whether the Symbol Table contains infinite precision variables.

Checks whether the Symbol Table contains infinite precision variables

boolean SymbTable_contains_word_variables ( const SymbTable_ptr  self  )  [related]

Checks whether the Symbol Table contains word variables.

Checks whether the Symbol Table contains word variables

SymbTable_ptr SymbTable_copy ( SymbTable_ptr  self,
Set_t  blacklist 
) [related]

Create a new SymbolTable which contains the same info as the given one except the specified symbols in blacklist, in the same environment.

Returned ST is allocated and has to be released by caller. The copy is performed iterating over each layer in the Symbol Table. The new ST contains a copy of each layer of the given Symbol Table

See also:
SymbTable_create SymbTable_destroy
SymbTable_ptr SymbTable_create ( NuSMVEnv_ptr  env  )  [related]

Class constructor.

Environment requisites:

  • OptsHandler instance registered as ENV_OPTS_HANDLER
  • StreamMgr instance registered as ENV_STREAM_MANAGER
  • NodeMgr instance registered as ENV_NODE_MGR
  • NodePrinter instance registered as ENV_WFF_PRINTER
  • UStringMgr instance registered as ENV_STRING_MGR
SymbLayer_ptr SymbTable_create_layer ( SymbTable_ptr  self,
const char *  layer_name,
const LayerInsertPolicy  ins_policy 
) [related]

Creates and adds a new layer.

The created layer is returned. Do not destroy the layer, since it belongs to self. if layer name is NULL, then a temporary name will be searched and a new layer will be created. To retrieve the layer name, query the returned SymbLayer instance. layer_name must not exist within self

See also:
remove_layer
void SymbTable_create_layer_class ( SymbTable_ptr  self,
const char *  class_name 
) [related]

Declares a new class of layers.

This method creates a new class of layers. The class must be not existing. The method can be used to create a class of layers that might be empty. It is not required to create a class before calling methods that use that class, like e.g. SymbTable_layer_add_to_class that wll create the class when not existing. class_name can be NULL to create the default class (whose name must have been previously specified with SymbTable_set_default_layers_class_name)

See also:
SymbTable_layer_add_to_class
SymbLayer_ptr SymbTable_define_get_layer ( SymbTable_ptr  self,
node_ptr  name 
) [related]

Returns the layer a DEFINE is defined in.

Returns the layer a DEFINE is defined in, NULL if there is no layer containing it.

void SymbTable_destroy ( SymbTable_ptr  self  )  [related]

Class destructor.

void SymbTable_foreach ( const SymbTable_ptr  self,
unsigned int  mask,
SymbTableForeachFun  fun,
void *  arg 
) [related]

Executes the given function over each symbol that satisfies the given symbol mask.

Executes the given function over each symbol that satisfies the given symbol mask

SymbLayer_ptr SymbTable_function_get_layer ( SymbTable_ptr  self,
node_ptr  name 
) [related]

Returns the layer a NFunction is defined in.

Returns the layer a NFunction is defined in, NULL if there is no layer containing it.

void SymbTable_gen_iter ( const SymbTable_ptr  self,
SymbTableIter iter,
unsigned int  mask 
) [related]

Initializes the given iterator with the given mask.

Initializes the given iterator with the given mask. It is fundamental to call this procedure before using the iterator.

SYMB_TABLE_FOREACH and SYMB_TABLE_FOREACH_FILTER automaticaly call this function, so the caller does not have to worry about that.

node_ptr SymbTable_get_actual_parameter ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the actual param of the given formal parameter.

node_ptr SymbTable_get_actual_parameter_context ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the context of the actual parameter associated with the given formal one.

node_ptr SymbTable_get_array_define_body ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the body of the given array define name.

node_ptr SymbTable_get_array_define_context ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the context of the given array define name.

node_ptr SymbTable_get_array_define_flatten_body ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the flattened body of the given array define name.

int SymbTable_get_array_defines_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all declared array define.

node_ptr SymbTable_get_array_lower_bound_variable ( const SymbTable_ptr  self,
node_ptr  array 
) [related]

Return the variable corresponding to lower bound of array.

array must be a valid variable array (NULL is never returned)

node_ptr SymbTable_get_array_upper_bound_variable ( const SymbTable_ptr  self,
node_ptr  array 
) [related]

Return the variable corresponding to upper bound of array.

array must be a valid variable array (NULL is never returned)

array_t * SymbTable_get_class_layer_names ( SymbTable_ptr  self,
const char *  class_name 
) [related]

Returns an array of layer names that belong to the given class name. If class_name is NULL, default class name will be taken (must be set before).

Specified class must be existing, or if NULL is specified a default class must have been defined. Returned array belongs to self and has NOT to be destroyed or changed by the caller.

const char * SymbTable_get_class_of_layer ( const SymbTable_ptr  self,
const char *  layer_name 
) [related]

Returns the name of the class in which the given layer is declared or NULL if there is no such a class.

int SymbTable_get_constants_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all declared constants.

const char * SymbTable_get_default_layers_class_name ( const SymbTable_ptr  self  )  [related]

Returns the default layers class name that has been previously set. The default layers class name is the class of layers that is taken when the system needs a default set of layers to work with. Typically the default class is the class of model layers, that is used for example when dumping the hierarchy by command write_bool_model.

Returned string belongs to self, and must be NOT destroyed or changed. Returned string is NULL if not previously set.

See also:
SymbTable_set_default_layers_class_name
node_ptr SymbTable_get_define_body ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the body of the given DEFINE.

node_ptr SymbTable_get_define_context ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the context of the given DEFINE name.

node_ptr SymbTable_get_define_flatten_body ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the flattenized body of the given define.

int SymbTable_get_defines_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all declared defines.

node_ptr SymbTable_get_determinization_var_name ( const SymbTable_ptr  self  )  [related]

Returns a valid name for a new determinization variable.

Returns a valid name for a new determinization variable. Searches in the symbol table for a variable name which is not declared yet, and returns it. Warning: This method does not declare a new variable, it simply finds a valid name for a new determinization variable. If the returned variable name is not used later to declare a new variable, succeed calls to this method may not return a valid name.

See also:
symb_table_deinit
node_ptr SymbTable_get_flatten_actual_parameter ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the flattenized actual parameter of the given formal parameter.

node_ptr SymbTable_get_fresh_symbol_name ( const SymbTable_ptr  self,
const char *  prefix 
) [related]

Given a prefix, returns a fresh symbol name. This function NEVER returns the same symbol twice and NEVER returns a declared name.

If prefix is NULL then a valid fresh symbol is choosed.

int SymbTable_get_frozen_vars_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all declared frozen variables.

NFunction_ptr SymbTable_get_function ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the NFunction with the given name.

node_ptr SymbTable_get_function_context ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the context of the NFunction with the given name.

SymbType_ptr SymbTable_get_function_type ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the type of a given function.

"name" is assumed to be a function

int SymbTable_get_functions_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all NFunctions.

hash_ptr SymbTable_get_handled_hash_ptr ( SymbTable_ptr  self,
const char *  key,
ST_PFICPCP  compare_func,
ST_PFICPI  hash_func,
ST_PFSR  destroy_func,
SymbTableTriggerFun  add_action,
SymbTableTriggerFun  remove_action,
SymbTableTriggerFun  redeclare_action 
) [related]

Retrieves a special hash_ptr instance handled by the SymbTable.

Retrieves a special hash_ptr instance handled by the SymbTable. If the given hash already exists in the SymbTable, then that instance is returned. Otherwise, a new one is created and added in the SymbTable. The returned hash_ptr will be freed by the SymbTable. Entries in such hash will be freed using <destroy_func>. Avoid multiple calls to this function if possible (e.g. in triggers, pass the hash_ptr as trigger argument). For a particular hash, this function has to be called always with the same arguments (they are ignored after the first call). This can be checked defining MEMOIZED_HASH_DEBUG. It is possible to request a customize hash table passing <compare_func> and <hash_func>.

It is even possible to pass functions to be triggered when the symbol table is modified. Tipically, an hash clearing function is passed as <remove_action>. For remove_action, for clearing the hash it may be useful to use function SymbTable_clear_handled_remove_action_hash.

int SymbTable_get_input_vars_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all declared input variables.

SymbLayer_ptr SymbTable_get_layer ( const SymbTable_ptr  self,
const char *  layer_name 
) [related]
Todo:
Missing synopsis
Todo:
Missing description
NodeList_ptr SymbTable_get_layers ( const SymbTable_ptr  self  )  [related]

Returns the list of owned layers.

The returned list belongs to self. Do not free or change it.

NodeList_ptr SymbTable_get_layers_i_symbols ( SymbTable_ptr  self,
const array_t layer_names 
) [related]

Returns the list of input symbols that belong to the given layers.

Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

NodeList_ptr SymbTable_get_layers_i_vars ( SymbTable_ptr  self,
const array_t layer_names 
) [related]

Returns the list of input variables that belong to the given layers.

Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

NodeList_ptr SymbTable_get_layers_sf_i_symbols ( SymbTable_ptr  self,
const array_t layer_names 
) [related]

Returns the list of state and input symbols that belong to the given layers, meaning those DEFINES whose body contain both state (or frozen) and input variables. This methods does _NOT_ return the state symbols plus the input symbols.

Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

NodeList_ptr SymbTable_get_layers_sf_i_vars ( SymbTable_ptr  self,
const array_t layer_names 
) [related]

Returns the list of variables that belong to the given layers.

Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

NodeList_ptr SymbTable_get_layers_sf_symbols ( SymbTable_ptr  self,
const array_t layer_names 
) [related]

Returns the list of state and frozen symbols that belong to the given layers.

Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller. Note: state symbols include frozen variables.

NodeList_ptr SymbTable_get_layers_sf_vars ( SymbTable_ptr  self,
const array_t layer_names 
) [related]

Returns the list of state and frozen variables that belong to the given layers.

Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

int SymbTable_get_parameters_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all parameters.

int SymbTable_get_state_vars_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all declared state variables.

SymbCategory SymbTable_get_symbol_category ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

This function returns the category of an identifier.

If a symbol is not properly recognized, SYMBOL_INVALID is returned.

An identifier is var or define. It is also allowed to have arrays with constant index, i.e. if V is identifier than V[5] is also identifier.

None

node_ptr SymbTable_get_symbol_from_str ( const SymbTable_ptr  self,
const char *  symbol_str 
) [related]

Given a string name, constructs a node and returns it, using the internal node and string managers.

NOTE: This method is used by SymbTable_get_fresh_symbol_name to construct a node out of a string.

SymbType_ptr SymbTable_get_symbol_type ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the type of a given symbol.

The type belongs to self, do not destroy it. Symbol must be declared, but if has no type (e.g. is a define), NULL is returned

int SymbTable_get_symbols_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all symbols.

TypeChecker_ptr SymbTable_get_type_checker ( const SymbTable_ptr  self  )  [related]

Returns the internally stored type checker.

Returned instance belongs to self

Set_t SymbTable_get_type_tags ( const SymbTable_ptr  self  )  [related]

Returns a set of type tags of all variables, variable arrays and functions contained in the symbol table.

Returns a set of SymbTypeTag, to be destroyed by the caller.

node_ptr SymbTable_get_var_array_from_element ( const SymbTable_ptr  self,
node_ptr  element 
) [related]

Return the variable array corresponding to element.

element must be a valid array element (NULL is never returned). An array element is a variable corresponding to an array index.

See also:
SymbTable_is_symbol_array_var_element
SymbType_ptr SymbTable_get_var_type ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the type of a given variable.

The type belongs to the layer, do not destroy it. "name" is assumed to be a var

SymbType_ptr SymbTable_get_variable_array_type ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns the type of the given var array.

int SymbTable_get_vars_num ( const SymbTable_ptr  self  )  [related]

Returns the number of all declared variables.

boolean SymbTable_has_layer ( const SymbTable_ptr  self,
const char *  layer_name 
) [related]

True if layer_name belongs to self.

True if layer_name belongs to self

boolean SymbTable_is_layer_in_class ( SymbTable_ptr  self,
const char *  layer_name,
const char *  class_name 
) [related]

Returns true if given layer name belongs to the given class.

If class_name is NULL, the default class will be checked

boolean SymbTable_is_symbol_array_define ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a declared array define.

boolean SymbTable_is_symbol_array_var_element ( const SymbTable_ptr  symb_table,
const node_ptr  name 
) [related]

Returns true iff this name is sub-element of a variable array.

boolean SymbTable_is_symbol_bool_var ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a variable of enum type with the values 0 and 1 (boolean).

boolean SymbTable_is_symbol_constant ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a declared constant.

Notice that this method will check only symbols defined within self. For example if an integer constant was not declared within self, this method will return false for it. For generic expressions, consider using function node_is_leaf which performs a purely-syntactly check.

boolean SymbTable_is_symbol_declared ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is declared.

boolean SymbTable_is_symbol_define ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a declared DEFINE.

boolean SymbTable_is_symbol_frozen_var ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a frozen variable.

boolean SymbTable_is_symbol_frozen_var_array ( const SymbTable_ptr  self,
node_ptr  array 
) [related]

True if the variables contained in array are frozen vars.

boolean SymbTable_is_symbol_function ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a declared NFunction.

boolean SymbTable_is_symbol_input_var ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is an input variable.

boolean SymbTable_is_symbol_input_var_array ( const SymbTable_ptr  self,
node_ptr  array 
) [related]

True if the variables contained in array are input vars.

boolean SymbTable_is_symbol_parameter ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a declared parameter.

boolean SymbTable_is_symbol_state_frozen_var ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a frozen or a state variable.

boolean SymbTable_is_symbol_state_var ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a state variable.

boolean SymbTable_is_symbol_state_var_array ( const SymbTable_ptr  self,
node_ptr  array 
) [related]

True if the variables contained in array are state vars.

boolean SymbTable_is_symbol_var ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is either a state, frozen or an input variable.

boolean SymbTable_is_symbol_variable_array ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given symbol is a declared variable array.

boolean SymbTable_is_var_finite ( const SymbTable_ptr  self,
const node_ptr  name 
) [related]

Returns true if the given variable has a finite domain.

unsigned int SymbTable_iter_count ( const SymbTable_ptr  self,
SymbTableIter  iter 
) [related]

Counts the elements of the iterator.

Counts the elements of the iterator. The iterator is NOT changed (it is passed as value..)

boolean SymbTable_iter_filter_i_symbols ( const SymbTable_ptr  self,
const node_ptr  sym,
void *  arg 
) [related]

Default iterator filter: Input symbols.

Default iterator filter: Input symbols. Only defines that predicate over input variables or input variables themselfs satisfy this filter.

boolean SymbTable_iter_filter_out_var_array_elems ( const SymbTable_ptr  self,
const node_ptr  sym,
void *  arg 
) [related]

Default iterator filter: skip var array elements.

Variables declared from an array are skipped

boolean SymbTable_iter_filter_sf_i_symbols ( const SymbTable_ptr  self,
const node_ptr  sym,
void *  arg 
) [related]

Default iterator filter: State, Frozen and Input symbols.

Default iterator filter: State, Frozen and Input symbols. Only defines that predicate over state or frozen AND input variables or variables themselfs satisfy this filter.

boolean SymbTable_iter_filter_sf_symbols ( const SymbTable_ptr  self,
const node_ptr  sym,
void *  arg 
) [related]

Default iterator filter: State, Frozen symbols.

Default iterator filter: State, Frozen symbols. Only defines that predicate over state or frozen variables or state / frozen variables themselfs satisfy this filter.

node_ptr SymbTable_iter_get_symbol ( const SymbTable_ptr  self,
const SymbTableIter iter 
) [related]

Gets the symbol pointed by the given iterator.

Gets the symbol pointed by the given iterator. The given iterator must not be at it's end

boolean SymbTable_iter_is_end ( const SymbTable_ptr  self,
const SymbTableIter iter 
) [related]

Checks if the iterator is at it's end.

Checks if the iterator is at it's end

void SymbTable_iter_next ( const SymbTable_ptr  self,
SymbTableIter iter 
) [related]

Moves the iterator to the next valid symbol.

Moves the iterator to the next valid symbol

void SymbTable_iter_set_filter ( const SymbTable_ptr  self,
SymbTableIter iter,
SymbTableIterFilterFun  fun,
void *  arg 
) [related]

Sets the filter to be used by the iterator.

Sets the filter to be used by the iterator. The iterator internally moves itself to the next valid symbol that satisfies both the filter and the mask

NodeList_ptr SymbTable_iter_to_list ( const SymbTable_ptr  self,
SymbTableIter  iter 
) [related]

Creates a set starting from the iterator.

Creates a list starting from the iterator. The list must be freed. The iterator is NOT changed (it is passed as value..)

Set_t SymbTable_iter_to_set ( const SymbTable_ptr  self,
SymbTableIter  iter 
) [related]

Creates a set starting from the iterator.

Creates a set starting from the iterator. The set must be freed. The iterator is NOT changed (it is passed as value..)

void SymbTable_layer_add_to_class ( SymbTable_ptr  self,
const char *  layer_name,
const char *  class_name 
) [related]

Adds a given layer (that must exist into self already) to a class of layers. Classes are used to group layers into possibly overlapping sets. For example the class of layers containing the set of symbols that belongs to the SMV model. If class_name is NULL, the default class name will be taken (must be set before).

A new class will be created if given class does not exist yet. The given layer must be existing.

See also:
SymbTable_layer_remove_from_class
boolean SymbTable_layer_class_exists ( SymbTable_ptr  self,
const char *  class_name 
) [related]

Checks if a class of layers exists.

This method checks if class 'class_name' has been previously created in the SymbTable.Returns true if the class exists, false otherwise.

None

void SymbTable_layer_remove_from_class ( SymbTable_ptr  self,
const char *  layer_name,
const char *  class_name 
) [related]

Removes a given layer (that must exist into self already) from a given class of layers. If class_name is NULL, the default class is taken (must be set before).

Given class must be existing, or if NULL default class must be existing. If the layer is not found, nothing happens.

See also:
SymbTable_layer_add_to_class
boolean SymbTable_list_contains_input_var ( const SymbTable_ptr  self,
const NodeList_ptr  var_list 
) [related]

Returns true if var_list contains at least one input variable, false otherwise.

The given list of variables is traversed until an input variable is found

boolean SymbTable_list_contains_state_frozen_var ( const SymbTable_ptr  self,
const NodeList_ptr  var_list 
) [related]

Returns true if var_list contains at least one state or frozen variable, false otherwise.

The given list of variables is traversed until a state or frozen variable is found

boolean SymbTable_list_contains_undef_var ( const SymbTable_ptr  self,
const NodeList_ptr  var_list 
) [related]

Returns true if the given symbols list contains one or more undeclared variable names, false otherwise.

Iterates through the elements in var_list checking each one to see if it is one undeclared variable.

void SymbTable_remove_layer ( SymbTable_ptr  self,
SymbLayer_ptr  layer 
) [related]

Removes and destroys a layer.

The layer must be not in use by any encoding, so remove it from all encodings before calling this method. The removed layer will be no longer available after the invocation of this method.

If given layer belongs to a set of layer classes, the layer will be removed from the classes as well (meaning that there is no need to remove the layer from the classes it belongs to)

If you are going to destroy the symb table, you could avoid this call

See also:
create_layer
void SymbTable_remove_trigger ( const SymbTable_ptr  self,
SymbTableTriggerFun  trigger,
SymbTableTriggerAction  action 
) [related]

Removes a trigger from the Symbol Table.

Removes a trigger from the Symbol Table

See also:
SymbTable_add_trigger
void SymbTable_rename_layer ( const SymbTable_ptr  self,
const char *  layer_name,
const char *  new_name 
) [related]

Renames an existing layer.

Use to rename an existing layer. Useful for example to substitute an existing layer with another.

ResolveSymbol_ptr SymbTable_resolve_symbol ( SymbTable_ptr  self,
node_ptr  expr,
node_ptr  context 
) [related]
void SymbTable_set_default_layers_class_name ( SymbTable_ptr  self,
const char *  class_name 
) [related]
char * SymbTable_sprint_category ( SymbTable_ptr  self,
node_ptr  symbol 
) [related]

Return the string version of the SymbCategory of symbol Returned string must NOT be freed.

SymbLayer_ptr SymbTable_symbol_get_layer ( SymbTable_ptr  self,
node_ptr  name 
) [related]

Returns the layer a symbol is defined in.

Returns the layer a symbol is defined in, NULL if there is no layer containing it.

SymbLayer_ptr SymbTable_variable_get_layer ( SymbTable_ptr  self,
node_ptr  name 
) [related]

Returns the layer a variable is defined in.

Returns the layer a variable is defined in, NULL if there is no layer containing it.


The documentation for this struct was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 14 Oct 2015 for NuSMV Developers Manual by  doxygen 1.6.1