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
00044 #ifndef __NUSMV_CORE_PROP_PROP_H__
00045 #define __NUSMV_CORE_PROP_PROP_H__
00046
00047 #if HAVE_CONFIG_H
00048 #include "nusmv-config.h"
00049 #endif
00050
00051 #include "nusmv/core/fsm/FsmBuilder.h"
00052 #include "nusmv/core/wff/ExprMgr.h"
00053 #include "nusmv/core/set/set.h"
00054 #include "nusmv/core/fsm/sexp/SexpFsm.h"
00055 #include "nusmv/core/fsm/sexp/BoolSexpFsm.h"
00056 #include "nusmv/core/fsm/bdd/BddFsm.h"
00057 #include "nusmv/core/fsm/be/BeFsm.h"
00058
00059 #include "nusmv/core/utils/object.h"
00060 #include "nusmv/core/utils/utils.h"
00061 #include "nusmv/core/utils/OStream.h"
00062
00063
00064
00065
00066
00076 enum _Prop_Status {Prop_NoStatus, Prop_Unchecked, Prop_True, Prop_False,
00077 Prop_Number, Prop_Error};
00078
00084 #define PROP_NOSTATUS_STRING "NoStatus"
00085
00091 #define PROP_UNCHECKED_STRING "Unchecked"
00092
00098 #define PROP_TRUE_STRING "True"
00099
00105 #define PROP_FALSE_STRING "False"
00106
00112 #define PROP_NUMBER_STRING "Number"
00113
00114
00121
00122 enum _Prop_Type {
00123 Prop_Prop_Type_First = 100,
00124
00125 Prop_NoType,
00126 Prop_Ctl,
00127 Prop_Ltl,
00128 Prop_Psl,
00129 Prop_Invar,
00130 Prop_Compute,
00131 Prop_CompId,
00132
00133 Prop_Prop_Type_Last
00134 };
00135
00136
00143 enum _PropDb_PrintFmt {
00144 PROPDB_PRINT_FMT_TABULAR,
00145 PROPDB_PRINT_FMT_DEFAULT = PROPDB_PRINT_FMT_TABULAR,
00146 PROPDB_PRINT_FMT_XML,
00147 };
00148
00149 enum _Prop_PrintFmt {
00150 PROP_PRINT_FMT_FORMULA,
00151 PROP_PRINT_FMT_FORMULA_TRUNC,
00152 PROP_PRINT_FMT_INDEX,
00153 PROP_PRINT_FMT_NAME,
00154 PROP_PRINT_FMT_DEFAULT = PROP_PRINT_FMT_FORMULA
00155 };
00156
00162 #define PROP_NOTYPE_STRING "NoType"
00163
00169 #define PROP_CTL_STRING "CTL"
00170
00176 #define PROP_LTL_STRING "LTL"
00177
00183 #define PROP_PSL_STRING "PSL"
00184
00190 #define PROP_INVAR_STRING "Invar"
00191
00197 #define PROP_COMPUTE_STRING "Quantitative"
00198
00199
00200
00201
00202 typedef enum _Prop_Status Prop_Status;
00203 typedef enum _Prop_Type Prop_Type;
00204 typedef enum _PropDb_PrintFmt PropDb_PrintFmt;
00205 typedef enum _Prop_PrintFmt Prop_PrintFmt;
00206
00213 typedef struct Prop_TAG* Prop_ptr;
00214
00221 #define PROP(self) \
00222 ((Prop_ptr) self)
00223
00229 #define PROP_CHECK_INSTANCE(self) \
00230 (nusmv_assert(PROP(self) != PROP(NULL)))
00231
00232
00233
00236
00237
00238
00239
00240
00254 Prop_ptr Prop_create(const NuSMVEnv_ptr env);
00255
00266 Prop_ptr Prop_create_partial(const NuSMVEnv_ptr env,
00267 Expr_ptr expr, Prop_Type type);
00268
00278 Prop_ptr Prop_copy(Prop_ptr input);
00279
00286 Prop_ptr Prop_create_from_string(NuSMVEnv_ptr env, char* str, Prop_Type type);
00287
00299 void Prop_destroy(Prop_ptr self);
00300
00301
00302
00303
00315 Expr_ptr Prop_get_expr(const Prop_ptr self);
00316
00335 Expr_ptr Prop_get_expr_core(const Prop_ptr self);
00336
00345 Expr_ptr Prop_get_expr_core_for_coi(const Prop_ptr self);
00346
00355 Expr_ptr Prop_get_flattened_expr(const Prop_ptr self, SymbTable_ptr st);
00356
00364 Set_t Prop_get_cone(const Prop_ptr self);
00365
00372 void Prop_set_cone(Prop_ptr self, Set_t cone);
00373
00381 Prop_Type Prop_get_type(const Prop_ptr self);
00382
00391 const char* Prop_get_type_as_string(Prop_ptr self);
00392
00399 node_ptr Prop_get_name(const Prop_ptr self);
00400
00407 char* Prop_get_name_as_string(const Prop_ptr self);
00408
00415 void Prop_set_name(Prop_ptr self, const node_ptr name);
00416
00425 SymbTable_ptr Prop_get_symb_table(const Prop_ptr self);
00426
00433 Prop_Status Prop_get_status(const Prop_ptr self);
00434
00444 const char* Prop_get_status_as_string(const Prop_ptr self);
00445
00453 int Prop_get_number(const Prop_ptr self);
00454
00464 char* Prop_get_number_as_string(const Prop_ptr self);
00465
00474 int Prop_get_trace(const Prop_ptr self);
00475
00482 void Prop_set_status(Prop_ptr self, Prop_Status s);
00483
00491 void Prop_set_number(Prop_ptr self, int n);
00492
00500 void Prop_set_number_infinite(Prop_ptr self);
00501
00509 void Prop_set_number_undefined(Prop_ptr self);
00510
00517 void Prop_set_trace(Prop_ptr self, int t);
00518
00525 int Prop_get_index(const Prop_ptr self);
00526
00533 void Prop_set_index(Prop_ptr self, const int index);
00534
00539 char* Prop_get_name_as_string(const Prop_ptr self);
00540
00549 SexpFsm_ptr
00550 Prop_compute_ground_sexp_fsm(const NuSMVEnv_ptr env, const Prop_ptr self);
00551
00560 BddFsm_ptr
00561 Prop_compute_ground_bdd_fsm(const NuSMVEnv_ptr env, const Prop_ptr self);
00562
00569 BeFsm_ptr
00570 Prop_compute_ground_be_fsm(const NuSMVEnv_ptr env, const Prop_ptr self);
00571
00580 SexpFsm_ptr Prop_get_scalar_sexp_fsm(const Prop_ptr self);
00581
00590 BoolSexpFsm_ptr Prop_get_bool_sexp_fsm(const Prop_ptr self);
00591
00599 BddFsm_ptr Prop_get_bdd_fsm(const Prop_ptr self);
00600
00609 BeFsm_ptr Prop_get_be_fsm(const Prop_ptr self);
00610
00618 void Prop_set_scalar_sexp_fsm(Prop_ptr self, SexpFsm_ptr fsm);
00619
00627 void Prop_set_bool_sexp_fsm(Prop_ptr self, BoolSexpFsm_ptr fsm);
00628
00636 void Prop_set_bdd_fsm(Prop_ptr self, BddFsm_ptr fsm);
00637
00645 void Prop_set_be_fsm(Prop_ptr self, BeFsm_ptr fsm);
00646
00653 char* Prop_get_text(const Prop_ptr self);
00654
00663 char* Prop_get_context_text(const Prop_ptr self);
00664
00665
00666
00667
00675 Set_t Prop_compute_cone(const Prop_ptr self,
00676 FlatHierarchy_ptr hierarchy,
00677 SymbTable_ptr symb_table);
00678
00686 void
00687 Prop_apply_coi_for_scalar(const NuSMVEnv_ptr env, Prop_ptr self);
00688
00700 void
00701 Prop_apply_coi_for_bdd(const NuSMVEnv_ptr env, Prop_ptr self);
00702
00722 void
00723 Prop_apply_coi_for_bmc(const NuSMVEnv_ptr env, Prop_ptr self);
00724
00737 void Prop_destroy_coi_for_bmc(Prop_ptr self);
00738
00739
00740
00741
00749 void Prop_print(Prop_ptr self, OStream_ptr file, Prop_PrintFmt fmt);
00750
00764 void Prop_print_db(Prop_ptr self, OStream_ptr file, PropDb_PrintFmt);
00765
00766
00767
00768 SexpFsm_ptr
00769 Prop_compute_ground_sexp_fsm(const NuSMVEnv_ptr env, const Prop_ptr self);
00770 BddFsm_ptr
00771 Prop_compute_ground_bdd_fsm(const NuSMVEnv_ptr env, const Prop_ptr self);
00772 BeFsm_ptr
00773 Prop_compute_ground_be_fsm(const NuSMVEnv_ptr env, const Prop_ptr self);
00774
00780 void Prop_set_environment_fsms(const NuSMVEnv_ptr env, Prop_ptr prop);
00781
00788 Set_t Prop_set_from_formula_list(NuSMVEnv_ptr env, node_ptr list, Prop_Type type);
00789
00796 Prop_ptr Prop_convert_to_invar(Prop_ptr self);
00797
00798
00799
00800
00806 boolean Prop_needs_rewriting(SymbTable_ptr st,
00807 const Prop_ptr self);
00808
00816 boolean Prop_is_psl_ltl(const Prop_ptr self);
00817
00825 boolean Prop_is_psl_obe(const Prop_ptr self);
00826
00836 void Prop_verify(Prop_ptr self);
00837
00847 int Prop_check_type(const Prop_ptr self, Prop_Type type);
00848
00849
00850
00851
00859 const char* PropType_to_string(const Prop_Type type);
00860
00867 const char* PropType_to_parsing_string(const Prop_Type type);
00868
00874 short int PropType_to_node_type(const Prop_Type type);
00875
00876
00881 #endif