#include <stdio.h>
#include "cudd/util.h"
#include "nusmv/core/node/NodeMgr.h"
#include "nusmv/core/cinit/NuSMVEnv.h"
Go to the source code of this file.
Defines | |
#define | caar(_n_) car(car(_n_)) |
#define | cadr(_n_) car(cdr(_n_)) |
#define | cdar(_n_) cdr(car(_n_)) |
#define | cddr(_n_) cdr(cdr(_n_)) |
#define | node_bdd_setcar(_n_, _b_) { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->left.bddtype = (_b_); } |
#define | node_bdd_setcdr(_n_, _b_) { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->right.bddtype = (_b_); } |
#define | NODE_CONS_LIST_FOREACH(list, iter) |
standard shortcut for iterating over a cons list | |
#define | Node_conslist_get(iter) car(iter) |
Get the current element of the node conslist iterator. | |
#define | NODE_FROM_INT(x) (PTR_FROM_INT(node_ptr, (x))) |
Casts the given int to a node_ptr. | |
#define | node_get_int(_n_) (_n_)->left.inttype |
#define | node_get_lineno(_n_) (_n_)->lineno |
#define | node_get_lstring(_n_) (_n_)->left.strtype |
#define | node_get_type(_n_) (_n_)->type |
#define | node_int_setcar(_n_, _b_) { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->left.inttype = (_b_); } |
#define | node_int_setcdr(_n_, _b_) { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->right.inttype = (_b_); } |
#define | node_node_setcar(_n_, _b_) { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->left.nodetype = (_b_); } |
#define | node_node_setcdr(_n_, _b_) { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->right.nodetype = (_b_); } |
#define | NODE_PTR(x) ((node_ptr) (x)) |
The header file of the node package. | |
#define | node_str_setcar(_n_, _b_) { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->left.strtype = (_b_); } |
#define | node_str_setcdr(_n_, _b_) { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->right.strtype = (_b_); } |
#define | NODE_TO_INT(x) (PTR_TO_INT(x)) |
Casts the given node_ptr to an int. | |
Functions | |
node_ptr | append (node_ptr, node_ptr) |
DEPRECATED Appends two lists and returns the result. | |
node_ptr | append_ns (NodeMgr_ptr nodemgr, node_ptr, node_ptr) |
DEPRECATED Appends two lists and returns the result. | |
node_ptr | car (node_ptr) |
Returns the left branch of a node. | |
node_ptr | cdr (node_ptr) |
Returns the right branch of a node. | |
node_ptr | copy_list (NodeMgr_ptr nodemgr, node_ptr l) |
DEPRECATED Returns a copy of a list. | |
node_ptr | even_elements (NodeMgr_ptr nodemgr, node_ptr) |
DEPRECATED Extracts even elements of list L. | |
void | free_list (NodeMgr_ptr nodemgr, node_ptr l) |
DEPRECATED Frees all the elements of the list. | |
int | in_list (node_ptr, node_ptr) |
DEPRECATED Checks list R to see if it contains the element N. | |
int | is_list_empty (node_ptr) |
DEPRECATED Returns 1 is the list is empty, 0 otherwise. | |
node_ptr | last (node_ptr) |
DEPRECATED Returns the last cons in X. | |
unsigned int | llength (node_ptr) |
DEPRECATED Returns the length of list r. | |
node_ptr | map (NodeMgr_ptr nodemgr, NPFN fun, node_ptr) |
DEPRECATED Applies FUN to successive cars of LISTs and returns the results as a list. | |
node_ptr | map2 (NodeMgr_ptr nodemgr, NPFNN fun, node_ptr, node_ptr) |
DEPRECATED Applies FUN to successive cars of LISTs and returns the results as a list. Lists l1 and l2 are traversed in parallel. | |
node_ptr | map_param (NodeMgr_ptr nodemgr, node_ptr(*fun)(node_ptr, void *), node_ptr l, void *) |
DEPRECATED Applies FUN to successive cars of LISTs and returns the results as a list. | |
node_ptr | new_list (void) |
DEPRECATED Returns a new empty list. | |
node_ptr | Node_conslist_add (NodeMgr_ptr nodemgr, node_ptr list, node_ptr element) |
Add an element to the list. | |
node_ptr | Node_conslist_remove (NodeMgr_ptr nodemgr, node_ptr list, node_ptr element) |
Remove an element from the list. | |
node_ptr | Node_find_boolean_type (NodeMgr_ptr nodemgr) |
Builds a boolean type node, suitable for HrcNode, FlatHierarchy. | |
node_ptr | Node_find_error_type (NodeMgr_ptr nodemgr) |
node_ptr | Node_find_integer_type (NodeMgr_ptr nodemgr) |
Builds a integer type node, suitable for HrcNode, FlatHierarchy. | |
node_ptr | Node_find_real_type (NodeMgr_ptr nodemgr) |
Builds a real type node, suitable for HrcNode, FlatHierarchy. | |
boolean | Node_is_conslist (node_ptr list) |
Debug function to check if a node_ptr is actually a cons list. | |
int | node_is_failure (node_ptr node) |
Returns 0 if given node is not a FAILURE node. | |
int | node_is_leaf (node_ptr node) |
boolean | Node_is_relation (node_ptr const expr) |
boolean | Node_is_symbol (node_ptr const node) |
Checks if a node is syntactally a symbol. | |
boolean | Node_is_temporal_op (node_ptr const node) |
True if node is a temporal operator. | |
void | node_pkg_init (NuSMVEnv_ptr env) |
Initializes the node package. | |
void | node_pkg_quit (NuSMVEnv_ptr env) |
Deinitializes the packages, finalizing all internal structures. | |
void | node_set_type (node_ptr, int) |
Replaces the type of the node. | |
node_ptr | node_subtract (NodeMgr_ptr nodemgr, node_ptr, node_ptr) |
DEPRECATED Deletes from list set2 the elements of list set1. | |
node_ptr | odd_elements (NodeMgr_ptr nodemgr, node_ptr) |
DEPRECATED Extracts odd elements of list L. | |
void | print_array_type (const NuSMVEnv_ptr env, FILE *output_stream, const node_ptr body) |
Print an ARRAY_TYPE structure in smv. | |
node_ptr | reverse (node_ptr) |
DEPRECATED Reverse a list. | |
node_ptr | reverse_ns (NodeMgr_ptr nodemgr, node_ptr) |
DEPRECATED reverses the list with no side-effect. | |
void | setcar (node_ptr, node_ptr) |
Replaces the car of X with Y. | |
void | setcdr (node_ptr, node_ptr) |
Replaces the cdr of X with Y. | |
void | swap_nodes (node_ptr *, node_ptr *) |
Swaps two nodes. | |
void | walk (VPFN fun, node_ptr) |
DEPRECATED Applies FUN to successive cars of LISTs. |
#define node_bdd_setcar | ( | _n_, | |||
_b_ | ) | { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->left.bddtype = (_b_); } |
#define node_bdd_setcdr | ( | _n_, | |||
_b_ | ) | { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->right.bddtype = (_b_); } |
#define NODE_CONS_LIST_FOREACH | ( | list, | |||
iter | ) |
#define Node_conslist_get | ( | iter | ) | car(iter) |
#define NODE_FROM_INT | ( | x | ) | (PTR_FROM_INT(node_ptr, (x))) |
Casts the given int to a node_ptr.
#define node_int_setcar | ( | _n_, | |||
_b_ | ) | { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->left.inttype = (_b_); } |
#define node_int_setcdr | ( | _n_, | |||
_b_ | ) | { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->right.inttype = (_b_); } |
#define node_node_setcar | ( | _n_, | |||
_b_ | ) | { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->left.nodetype = (_b_); } |
#define node_node_setcdr | ( | _n_, | |||
_b_ | ) | { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->right.nodetype = (_b_); } |
#define NODE_PTR | ( | x | ) | ((node_ptr) (x)) |
The header file of the node
package.
Casts the given pointer to a node_ptr
#define node_str_setcar | ( | _n_, | |||
_b_ | ) | { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->left.strtype = (_b_); } |
#define node_str_setcdr | ( | _n_, | |||
_b_ | ) | { /*nusmv_assert(!(_n_)->locked);*/ (_n_)->right.strtype = (_b_); } |
#define NODE_TO_INT | ( | x | ) | (PTR_TO_INT(x)) |
Casts the given node_ptr to an int.
node_ptr append | ( | node_ptr | , | |
node_ptr | ||||
) |
DEPRECATED Appends two lists and returns the result.
Constructs a new list by concatenating its arguments.
The modified list is returned. Side effects on the returned list were performed. It is equivalent to the lisp NCONC
node_ptr append_ns | ( | NodeMgr_ptr | nodemgr, | |
node_ptr | , | |||
node_ptr | ||||
) |
DEPRECATED Appends two lists and returns the result.
Constructs a new list by concatenating its arguments.
The modified list is returned. No side effects on the returned list were performed.
node_ptr car | ( | node_ptr | ) |
node_ptr cdr | ( | node_ptr | ) |
node_ptr copy_list | ( | NodeMgr_ptr | nodemgr, | |
node_ptr | l | |||
) |
DEPRECATED Returns a copy of a list.
An invoker should free the returned list.
free_list
node_ptr even_elements | ( | NodeMgr_ptr | nodemgr, | |
node_ptr | ||||
) |
DEPRECATED Extracts even elements of list L.
Extracts even elements of list L.
None
void free_list | ( | NodeMgr_ptr | nodemgr, | |
node_ptr | l | |||
) |
DEPRECATED Frees all the elements of the list.
Frees all the elements of the list for further use.
None
int in_list | ( | node_ptr | , | |
node_ptr | ||||
) |
DEPRECATED Checks list R to see if it contains the element N.
Checks list R to see if it contains the element N.
None
int is_list_empty | ( | node_ptr | ) |
DEPRECATED Returns 1 is the list is empty, 0 otherwise.
None
node_ptr last | ( | node_ptr | ) |
unsigned int llength | ( | node_ptr | ) |
DEPRECATED Returns the length of list r.
Returns the length of list r.
None
node_ptr map | ( | NodeMgr_ptr | nodemgr, | |
NPFN | fun, | |||
node_ptr | ||||
) |
node_ptr map2 | ( | NodeMgr_ptr | nodemgr, | |
NPFNN | fun, | |||
node_ptr | , | |||
node_ptr | ||||
) |
node_ptr map_param | ( | NodeMgr_ptr | nodemgr, | |
node_ptr(*)(node_ptr, void *) | fun, | |||
node_ptr | l, | |||
void * | ||||
) |
node_ptr new_list | ( | void | ) |
DEPRECATED Returns a new empty list.
None
node_ptr Node_conslist_add | ( | NodeMgr_ptr | nodemgr, | |
node_ptr | list, | |||
node_ptr | element | |||
) |
Add an element to the list.
This is a functional interface, so to modify "list" the snippet is:
list = Node_conslist_add(nodemgr, list, element);
node_ptr Node_conslist_remove | ( | NodeMgr_ptr | nodemgr, | |
node_ptr | list, | |||
node_ptr | element | |||
) |
Remove an element from the list.
Linear time
node_ptr Node_find_boolean_type | ( | NodeMgr_ptr | nodemgr | ) |
Builds a boolean type node, suitable for HrcNode, FlatHierarchy.
It is of the same shape the parse uses.
node_ptr Node_find_error_type | ( | NodeMgr_ptr | nodemgr | ) |
node_ptr Node_find_integer_type | ( | NodeMgr_ptr | nodemgr | ) |
Builds a integer type node, suitable for HrcNode, FlatHierarchy.
It is of the same shape the parse uses.
node_ptr Node_find_real_type | ( | NodeMgr_ptr | nodemgr | ) |
Builds a real type node, suitable for HrcNode, FlatHierarchy.
It is of the same shape the parse uses.
boolean Node_is_conslist | ( | node_ptr | list | ) |
Debug function to check if a node_ptr is actually a cons list.
Debug function to check if a node_ptr is actually a cons list
boolean Node_is_symbol | ( | node_ptr const | node | ) |
boolean Node_is_temporal_op | ( | node_ptr const | node | ) |
True if node is a temporal operator.
No recursion is performed Warning, some case missing. What about PSL, for instance?
void node_pkg_init | ( | NuSMVEnv_ptr | env | ) |
Initializes the node package.
Creates master and printers, and initializes the node structures
void node_pkg_quit | ( | NuSMVEnv_ptr | env | ) |
Deinitializes the packages, finalizing all internal structures.
void node_set_type | ( | node_ptr | , | |
int | ||||
) |
node_ptr node_subtract | ( | NodeMgr_ptr | nodemgr, | |
node_ptr | , | |||
node_ptr | ||||
) |
DEPRECATED Deletes from list set2 the elements of list set1.
Deletes elements of list set1 from list set2 without doing side effect. The resulting list is returned. This is quite inefficient: O(|set1| * |set2|) where |<parameter>| denote the length of the list
None
node_ptr odd_elements | ( | NodeMgr_ptr | nodemgr, | |
node_ptr | ||||
) |
DEPRECATED Extracts odd elements of list L.
Extracts odd elements of list L.
None
void print_array_type | ( | const NuSMVEnv_ptr | env, | |
FILE * | output_stream, | |||
const node_ptr | body | |||
) |
Print an ARRAY_TYPE structure in smv.
node_ptr reverse | ( | node_ptr | ) |
node_ptr reverse_ns | ( | NodeMgr_ptr | nodemgr, | |
node_ptr | ||||
) |
DEPRECATED reverses the list with no side-effect.
Returns a reversed version of the given list. The original list is NOT modified
None
void setcar | ( | node_ptr | , | |
node_ptr | ||||
) |
void setcdr | ( | node_ptr | , | |
node_ptr | ||||
) |
void swap_nodes | ( | node_ptr * | , | |
node_ptr * | ||||
) |
Swaps two nodes.
Swaps two nodes.
The two nodes are swapped.