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_PROP_PROP_DB_H__
00040 #define __NUSMV_CORE_PROP_PROP_DB_H__
00041
00042 #include "nusmv/core/prop/Prop.h"
00043
00044 #include "nusmv/core/utils/object.h"
00045 #include "nusmv/core/utils/utils.h"
00046 #include "nusmv/core/utils/list.h"
00047 #include "nusmv/core/utils/ErrorMgr.h"
00048
00049
00050
00051
00052
00053
00060 typedef struct PropDb_TAG* PropDb_ptr;
00061
00068 #define PROP_DB(self) \
00069 ((PropDb_ptr) self)
00070
00076 #define PROP_DB_CHECK_INSTANCE(self) \
00077 (nusmv_assert(PROP_DB(self) != PROP_DB(NULL)))
00078
00084 #define PROP_DB_FOREACH(self, i) \
00085 for (i = 0; i < PropDb_get_size(self); ++i)
00086
00087
00090
00091
00092
00093
00094
00095
00104 PropDb_ptr PropDb_create(NuSMVEnv_ptr env);
00105
00114 void PropDb_destroy(PropDb_ptr self);
00115
00122 void PropDb_clean(PropDb_ptr self);
00123
00124
00125
00126
00127
00133 lsList PropDb_get_props_of_type(const PropDb_ptr self,
00134 const Prop_Type type);
00135
00143 lsList PropDb_get_ordered_props_of_type(const PropDb_ptr self,
00144 const FlatHierarchy_ptr hierarchy,
00145 const Prop_Type type);
00146
00161 NodeList_ptr
00162 PropDb_get_ordered_properties(const PropDb_ptr self,
00163 const FlatHierarchy_ptr hierarchy);
00164
00180 NodeList_ptr
00181 PropDb_get_coi_grouped_properties(const PropDb_ptr self,
00182 const FlatHierarchy_ptr hierarchy);
00183
00193 lsList PropDb_prepare_prop_list(const PropDb_ptr self,
00194 const Prop_Type type);
00195
00196
00197
00198
00206 Prop_ptr PropDb_get_last(const PropDb_ptr self);
00207
00215 Prop_ptr PropDb_get_prop_at_index(const PropDb_ptr self,
00216 int num);
00217
00231 Set_t PropDb_get_props_at_indices(const PropDb_ptr self,
00232 const ErrorMgr_ptr errmgr,
00233 const char* indices);
00234
00235
00236
00237
00245 int PropDb_get_prop_name_index(const PropDb_ptr self,
00246 const node_ptr name);
00247
00256 int PropDb_get_prop_index_from_string(const PropDb_ptr self,
00257 const char* idx);
00258
00266 int PropDb_get_prop_index_from_trace_index(const PropDb_ptr self,
00267 const int trace_idx);
00268
00269
00277 int PropDb_get_size(const PropDb_ptr self);
00278
00290 int PropDb_prop_parse_name(const PropDb_ptr self,
00291 const char* str);
00292
00302 PropDb_PrintFmt PropDb_set_print_fmt(const PropDb_ptr self,
00303 PropDb_PrintFmt new_fmt);
00304
00305
00306
00307
00317 void PropDb_print_list_header(const PropDb_ptr self,
00318 OStream_ptr file);
00319
00329 void PropDb_print_list_footer(const PropDb_ptr self,
00330 OStream_ptr file);
00331
00336 int PropDb_print_prop_at_index(const PropDb_ptr self,
00337 OStream_ptr file, const int index);
00338
00346 void PropDb_print_all(const PropDb_ptr self,
00347 OStream_ptr file);
00348
00356 void PropDb_print_all_type(const PropDb_ptr self,
00357 OStream_ptr file, Prop_Type type);
00358
00366 void PropDb_print_all_status(const PropDb_ptr self,
00367 OStream_ptr file, Prop_Status status);
00368
00377 void PropDb_print_all_status_type(const PropDb_ptr self,
00378 OStream_ptr file, Prop_Status status,
00379 Prop_Type type);
00380
00381
00382
00383
00391 int
00392 PropDb_check_property(const PropDb_ptr self,
00393 const Prop_Type pt,
00394 const char* formula,
00395 const int prop_no);
00396
00405 void PropDb_verify_all(const PropDb_ptr self);
00406
00416 void PropDb_verify_all_type(const PropDb_ptr self, Prop_Type);
00417
00426 void PropDb_ordered_verify_all(const PropDb_ptr self,
00427 const FlatHierarchy_ptr hierarchy);
00428
00441 void
00442 PropDb_ordered_verify_all_type(const PropDb_ptr self,
00443 const FlatHierarchy_ptr hierarchy,
00444 const Prop_Type type);
00445
00456 void PropDb_verify_prop_at_index(const PropDb_ptr self,
00457 const int index);
00458
00466 void PropDb_verify_all_type_wrapper(PropDb_ptr const self,
00467 const Prop_Type type);
00468
00469
00470
00482 int PropDb_prop_parse_and_add(const PropDb_ptr self,
00483 SymbTable_ptr symb_table,
00484 const char* str,
00485 const Prop_Type type,
00486 const node_ptr expr_name);
00487
00496 PropDb_PrintFmt PropDb_get_print_fmt(const PropDb_ptr self);
00497
00506 int
00507 PropDb_fill(PropDb_ptr self, SymbTable_ptr symb_table,
00508 node_ptr, node_ptr, node_ptr,
00509 node_ptr, node_ptr);
00510
00519 boolean PropDb_add(PropDb_ptr self, Prop_ptr);
00520
00530 int
00531 PropDb_prop_create_and_add(PropDb_ptr self, SymbTable_ptr symb_table,
00532 node_ptr, Prop_Type);
00533
00542 int
00543 PropDb_show_property(const PropDb_ptr self,
00544 const boolean print_props_num,
00545 const PropDb_PrintFmt fmt,
00546 const Prop_Type type,
00547 const Prop_Status status,
00548 const int prop_no,
00549 FILE* outstream);
00550
00557 boolean
00558 PropDb_is_prop_registered(PropDb_ptr self,
00559 Prop_ptr prop);
00560
00561
00564 #endif