00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00039 #ifndef __NUSMV_CORE_HRC_HRC_NODE_H__
00040 #define __NUSMV_CORE_HRC_HRC_NODE_H__
00041
00042 #if HAVE_CONFIG_H
00043 # include "nusmv-config.h"
00044 #endif
00045
00046 #include <stdlib.h>
00047 #include <stdio.h>
00048 #include "nusmv/core/utils/utils.h"
00049 #include "nusmv/core/node/node.h"
00050 #include "nusmv/core/utils/Slist.h"
00051 #include "nusmv/core/utils/Olist.h"
00052 #include "nusmv/core/compile/symb_table/SymbTable.h"
00053
00060 typedef struct HrcNode_TAG* HrcNode_ptr;
00061
00062
00063
00064
00065
00072 #define HRC_NODE(self) \
00073 ((HrcNode_ptr) self)
00074
00080 #define HRC_NODE_CHECK_INSTANCE(self) \
00081 (nusmv_assert(HRC_NODE(self) != HRC_NODE(NULL)))
00082
00083
00084
00087
00088
00089
00090
00091
00092
00101 HrcNode_ptr HrcNode_create(const NuSMVEnv_ptr env);
00102
00115 HrcNode_ptr HrcNode_copy(const HrcNode_ptr self);
00116
00131 HrcNode_ptr HrcNode_copy_rename(const HrcNode_ptr self,
00132 node_ptr new_module_name);
00133
00142 HrcNode_ptr HrcNode_recursive_copy(const HrcNode_ptr self);
00143
00154 void HrcNode_cleanup(HrcNode_ptr self);
00155
00166 void HrcNode_destroy(HrcNode_ptr self);
00167
00178 void HrcNode_destroy_recur(HrcNode_ptr self);
00179
00180
00181
00182
00193 void HrcNode_set_symbol_table(HrcNode_ptr self, SymbTable_ptr st);
00194
00205 SymbTable_ptr HrcNode_get_symbol_table(HrcNode_ptr self);
00206
00217 void HrcNode_set_lineno(HrcNode_ptr self, int lineno);
00218
00229 int HrcNode_get_lineno(const HrcNode_ptr self);
00230
00241 void HrcNode_set_name(HrcNode_ptr self, node_ptr name);
00242
00243
00255 node_ptr HrcNode_get_name(const HrcNode_ptr self);
00256
00257
00271 node_ptr HrcNode_get_crude_name(const HrcNode_ptr self);
00272
00283 void HrcNode_set_instance_name(HrcNode_ptr self, node_ptr name);
00284
00295 node_ptr HrcNode_get_instance_name(const HrcNode_ptr self);
00296
00313 node_ptr HrcNode_get_flattened_instance_name(const HrcNode_ptr self);
00314
00325 void HrcNode_set_parent(const HrcNode_ptr self, HrcNode_ptr father);
00326
00327
00339 HrcNode_ptr HrcNode_get_parent(const HrcNode_ptr self);
00340
00352 HrcNode_ptr HrcNode_get_root(const HrcNode_ptr self);
00353
00364 void HrcNode_replace_formal_parameters(HrcNode_ptr self, Olist_ptr par);
00365
00378 Oiter HrcNode_get_formal_parameters_iter(const HrcNode_ptr self);
00379
00392 void HrcNode_add_formal_parameter(HrcNode_ptr self, node_ptr par);
00393
00410 node_ptr HrcNode_find_formal_parameter(const HrcNode_ptr self,
00411 node_ptr par_name);
00412
00419 int HrcNode_get_formal_parameters_length(const HrcNode_ptr self);
00420
00431 void HrcNode_replace_actual_parameters(HrcNode_ptr self, Olist_ptr par);
00432
00446 Oiter HrcNode_get_actual_parameters_iter(const HrcNode_ptr self);
00447
00460 void HrcNode_add_actual_parameter(HrcNode_ptr self, node_ptr par);
00461
00468 int HrcNode_get_actual_parameters_length(const HrcNode_ptr self);
00469
00480 void HrcNode_replace_state_variables(HrcNode_ptr self, Olist_ptr vars);
00481
00494 Oiter HrcNode_get_state_variables_iter(const HrcNode_ptr self);
00495
00508 void HrcNode_add_state_variable(HrcNode_ptr self, node_ptr var);
00509
00520 void HrcNode_replace_input_variables(HrcNode_ptr self, Olist_ptr vars);
00521
00534 Oiter HrcNode_get_input_variables_iter(const HrcNode_ptr self);
00535
00548 void HrcNode_add_input_variable(HrcNode_ptr self, node_ptr var);
00549
00562 void HrcNode_replace_frozen_variables(HrcNode_ptr self, Olist_ptr vars);
00563
00576 Oiter HrcNode_get_frozen_variables_iter(const HrcNode_ptr self);
00577
00590 void HrcNode_add_frozen_variable(HrcNode_ptr self, node_ptr var);
00591
00604 void HrcNode_replace_frozen_functions(HrcNode_ptr self, Olist_ptr functions);
00605
00618 Oiter HrcNode_get_frozen_functions_iter(const HrcNode_ptr self);
00619
00630 void HrcNode_add_frozen_function(HrcNode_ptr self, node_ptr fun);
00631
00642 void HrcNode_replace_defines(HrcNode_ptr self, Olist_ptr defs);
00643
00656 Oiter HrcNode_get_defines_iter(const HrcNode_ptr self);
00657
00670 void HrcNode_add_define(HrcNode_ptr self, node_ptr def);
00671
00687 node_ptr HrcNode_find_define(const HrcNode_ptr self,
00688 node_ptr def_name);
00689
00702 void HrcNode_replace_array_defines(HrcNode_ptr self, Olist_ptr mdefs);
00703
00716 Oiter HrcNode_get_array_defines_iter(const HrcNode_ptr self);
00717
00730 void HrcNode_add_array_define(HrcNode_ptr self, node_ptr mdef);
00731
00732
00733
00746 void HrcNode_replace_init_exprs(HrcNode_ptr self, Olist_ptr exprs);
00747
00759 Oiter HrcNode_get_init_exprs_iter(const HrcNode_ptr self);
00760
00771 void HrcNode_add_init_expr(HrcNode_ptr self, node_ptr expr);
00772
00773
00774
00787 void HrcNode_replace_init_assign_exprs(HrcNode_ptr self, Olist_ptr assigns);
00788
00800 Oiter HrcNode_get_init_assign_exprs_iter(const HrcNode_ptr self);
00801
00814 void HrcNode_add_init_assign_expr(HrcNode_ptr self, node_ptr assign);
00815
00816
00817
00830 void HrcNode_replace_invar_exprs(HrcNode_ptr self, Olist_ptr exprs);
00831
00843 Oiter HrcNode_get_invar_exprs_iter(const HrcNode_ptr self);
00844
00855 void HrcNode_add_invar_expr(HrcNode_ptr self, node_ptr expr);
00856
00857
00858
00870 void HrcNode_replace_invar_assign_exprs(HrcNode_ptr self, Olist_ptr assigns);
00871
00883 Oiter HrcNode_get_invar_assign_exprs_iter(const HrcNode_ptr self);
00884
00897 void HrcNode_add_invar_assign_expr(HrcNode_ptr self, node_ptr assign);
00898
00899
00900
00901
00913 void HrcNode_replace_trans_exprs(HrcNode_ptr self, Olist_ptr exprs);
00914
00926 Oiter HrcNode_get_trans_exprs_iter(const HrcNode_ptr self);
00927
00938 void HrcNode_add_trans_expr(HrcNode_ptr self, node_ptr expr);
00939
00940
00941
00953 void HrcNode_replace_next_assign_exprs(HrcNode_ptr self, Olist_ptr assigns);
00954
00966 Oiter HrcNode_get_next_assign_exprs_iter(const HrcNode_ptr self);
00967
00980 void HrcNode_add_next_assign_expr(HrcNode_ptr self, node_ptr assign);
00981
00982
00983
00994 void HrcNode_replace_justice_exprs(HrcNode_ptr self, Olist_ptr justices);
00995
01006 Oiter HrcNode_get_justice_exprs_iter(const HrcNode_ptr self);
01007
01018 void HrcNode_add_justice_expr(HrcNode_ptr self, node_ptr justice);
01019
01020
01021
01032 void HrcNode_replace_compassion_exprs(HrcNode_ptr self, Olist_ptr compassions);
01033
01044 Oiter HrcNode_get_compassion_exprs_iter(const HrcNode_ptr self);
01045
01056 void HrcNode_add_compassion_expr(HrcNode_ptr self, node_ptr compassion);
01057
01058
01059
01070 void HrcNode_replace_constants(HrcNode_ptr self, Olist_ptr constants);
01071
01082 Oiter HrcNode_get_constants_iter(const HrcNode_ptr self);
01083
01098 void HrcNode_add_constants(HrcNode_ptr self, node_ptr constant);
01099
01100
01101
01112 void HrcNode_replace_ctl_properties(HrcNode_ptr self, Olist_ptr ctls);
01113
01124 Oiter HrcNode_get_ctl_properties_iter(const HrcNode_ptr self);
01125
01136 void HrcNode_add_ctl_property_expr(HrcNode_ptr self, node_ptr ctl);
01137
01138
01139
01150 void HrcNode_replace_ltl_properties(HrcNode_ptr self, Olist_ptr ltls);
01151
01162 Oiter HrcNode_get_ltl_properties_iter(const HrcNode_ptr self);
01163
01174 void HrcNode_add_ltl_property_expr(HrcNode_ptr self, node_ptr ltl);
01175
01176
01177
01188 void HrcNode_replace_psl_properties(HrcNode_ptr self, Olist_ptr psls);
01189
01200 Oiter HrcNode_get_psl_properties_iter(const HrcNode_ptr self);
01201
01212 void HrcNode_add_psl_property_expr(HrcNode_ptr self, node_ptr psl);
01213
01214
01215
01226 void HrcNode_replace_invar_properties(HrcNode_ptr self, Olist_ptr invars);
01227
01238 Oiter HrcNode_get_invar_properties_iter(const HrcNode_ptr self);
01239
01250 void HrcNode_add_invar_property_expr(HrcNode_ptr self, node_ptr invar);
01251
01252
01253
01264 void HrcNode_replace_compute_properties(HrcNode_ptr self, Olist_ptr computes);
01265
01276 Oiter HrcNode_get_compute_properties_iter(const HrcNode_ptr self);
01277
01288 void HrcNode_add_compute_property_expr(HrcNode_ptr self, node_ptr compute);
01289
01298 void HrcNode_set_undef(const HrcNode_ptr self, void* undef);
01299
01308 void* HrcNode_get_undef(const HrcNode_ptr self);
01309
01310
01311
01323 void HrcNode_set_child_hrc_nodes(HrcNode_ptr self, Slist_ptr list);
01324
01337 void HrcNode_add_child_hrc_node(HrcNode_ptr self, HrcNode_ptr node);
01338
01345 Slist_ptr HrcNode_get_child_hrc_nodes(const HrcNode_ptr self);
01346
01347
01348
01349
01360 boolean HrcNode_can_declare_assign(HrcNode_ptr self, node_ptr symbol,
01361 int assign_type);
01362
01374 boolean HrcNode_is_root(const HrcNode_ptr self);
01375
01387 boolean HrcNode_is_leaf(const HrcNode_ptr self);
01388
01389
01390
01391
01392
01405 HrcNode_ptr
01406 HrcNode_find_hrc_node_by_mod_type(const HrcNode_ptr self,
01407 node_ptr mod_type);
01408
01409
01410
01424 Olist_ptr
01425 HrcNode_find_hrc_nodes_by_mod_type(const HrcNode_ptr self,
01426 const node_ptr mod_type);
01427
01428
01429
01442 HrcNode_ptr
01443 HrcNode_find_hrc_node_by_instance_name(const HrcNode_ptr self,
01444 node_ptr name);
01445
01446
01447
01465 node_ptr
01466 HrcNode_find_var(HrcNode_ptr self, node_ptr var_name, int type);
01467
01475 node_ptr
01476 HrcNode_find_var_all(HrcNode_ptr self, node_ptr var_name);
01477
01484 void HrcNode_link_nodes(HrcNode_ptr self, HrcNode_ptr child);
01485
01493 void HrcNode_unlink_nodes(HrcNode_ptr self, HrcNode_ptr child);
01494
01502 void HrcNode_remove_state_variable(HrcNode_ptr self,
01503 node_ptr var);
01504
01512 void HrcNode_remove_frozen_variable(HrcNode_ptr self,
01513 node_ptr var);
01514
01522 void HrcNode_remove_input_variable(HrcNode_ptr self,
01523 node_ptr var);
01524
01531 int HrcNode_get_vars_num(const HrcNode_ptr self);
01532
01539 int HrcNode_get_state_vars_num(const HrcNode_ptr self);
01540
01547 int HrcNode_get_frozen_vars_num(const HrcNode_ptr self);
01548
01555 int HrcNode_get_input_vars_num(const HrcNode_ptr self);
01556
01563 int HrcNode_get_defines_num(const HrcNode_ptr self);
01564
01571 int HrcNode_get_array_defines_num(const HrcNode_ptr self);
01572
01579 int HrcNode_get_parameters_num(const HrcNode_ptr self);
01580
01589 int HrcNode_get_constants_num(const HrcNode_ptr self);
01590
01596 int HrcNode_get_functions_num(const HrcNode_ptr self);
01597
01604 int HrcNode_get_symbols_num(const HrcNode_ptr self);
01605
01606
01607
01608
01611 #endif