00001 00002 /* --------------------------------------------------------------------------- 00003 00004 00005 This file is part of the ``utils'' package of NuSMV version 2. 00006 Copyright (C) 2009 by FBK-irst. 00007 00008 NuSMV version 2 is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Lesser General Public 00010 License as published by the Free Software Foundation; either 00011 version 2 of the License, or (at your option) any later version. 00012 00013 NuSMV version 2 is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with this library; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00021 00022 For more information on NuSMV see <http://nusmv.fbk.eu> 00023 or email to <nusmv-users@fbk.eu>. 00024 Please report bugs to <nusmv-users@fbk.eu>. 00025 00026 To contact the NuSMV development board, email to <nusmv@fbk.eu>. 00027 00028 -----------------------------------------------------------------------------*/ 00029 00040 #ifndef __NUSMV_CORE_UTILS_NODE_GRAPH_H__ 00041 #define __NUSMV_CORE_UTILS_NODE_GRAPH_H__ 00042 00043 00044 #include "nusmv/core/node/node.h" 00045 #include "nusmv/core/set/set.h" 00046 #include "nusmv/core/utils/utils.h" 00047 #include "nusmv/core/node/printers/MasterPrinter.h" 00048 00055 typedef struct NodeGraph_TAG* NodeGraph_ptr; 00056 00063 #define NODE_GRAPH(self) \ 00064 ((NodeGraph_ptr) self) 00065 00071 #define NODE_GRAPH_CHECK_INSTANCE(self) \ 00072 (nusmv_assert(NODE_GRAPH(self) != NODE_GRAPH(NULL))) 00073 00074 00075 00078 /*---------------------------------------------------------------------------*/ 00079 /* Function prototypes */ 00080 /*---------------------------------------------------------------------------*/ 00081 00090 NodeGraph_ptr NodeGraph_create(void); 00091 00100 void NodeGraph_destroy(NodeGraph_ptr self); 00101 00111 void 00112 NodeGraph_add_children(NodeGraph_ptr self, node_ptr var, 00113 const Set_t children); 00114 00119 void 00120 NodeGraph_remove_nodes(NodeGraph_ptr self, const Set_t nodes); 00121 00126 void NodeGraph_clear_removed_nodes(NodeGraph_ptr self); 00127 00133 boolean NodeGraph_is_empty(const NodeGraph_ptr self); 00134 00141 Set_t NodeGraph_get_leaves(const NodeGraph_ptr self); 00142 00153 Set_t NodeGraph_get_parents(const NodeGraph_ptr self, 00154 node_ptr child); 00155 00160 void NodeGraph_print(const NodeGraph_ptr self, 00161 MasterPrinter_ptr printer, 00162 FILE* out); 00163 00164 00169 #endif /* __NUSMV_CORE_UTILS_NODE_GRAPH_H__ */