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
00038 #ifndef __NUSMV_CORE_BMC_BMC_INT_H__
00039 #define __NUSMV_CORE_BMC_BMC_INT_H__
00040
00041
00042 #include <time.h>
00043 #include <limits.h>
00044 #include <stdio.h>
00045
00046
00047 #include "nusmv/core/enc/be/BeEnc.h"
00048
00049 #include "nusmv/core/fsm/FsmBuilder.h"
00050 #include "nusmv/core/compile/compile.h"
00051
00052 #include "nusmv/core/be/be.h"
00053
00054 #include "nusmv/core/trace/Trace.h"
00055 #include "nusmv/core/trace/TraceMgr.h"
00056
00057 #include "nusmv/core/dd/dd.h"
00058 #include "nusmv/core/opt/opt.h"
00059 #include "nusmv/core/node/node.h"
00060 #include "nusmv/core/utils/utils.h"
00061
00062
00063
00064
00065
00066
00067
00068
00069
00075 #define BMC_DUMP_FILENAME_MAXLEN 4096
00076
00082 #define BMC_NO_PROPERTY_INDEX -1
00083
00089 #define BMC_BEXP_OUTPUT_SMV 0
00090
00096 #define BMC_BEXP_OUTPUT_LB 1
00097
00098
00099
00105 #define DEFAULT_DIMACS_FILENAME "@f_k@k_l@l_n@n"
00106
00112 #define DEFAULT_INVAR_DIMACS_FILENAME "@f_invar_n@n"
00113
00119 #define DEFAULT_BMC_PB_LENGTH 10
00120
00126 #define DEFAULT_BMC_PB_LOOP Bmc_Utils_GetAllLoopbacksString()
00127
00133 #define DEFAULT_BMC_INVAR_ALG "classic"
00134
00140 #define DEFAULT_BMC_INC_INVAR_ALG "dual"
00141
00147 #define DEFAULT_BMC_OPTIMIZED_TABLEAU 1
00148
00154 #define DEFAULT_BMC_FORCE_PLTL_TABLEAU 0
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00175 #define ST_BMC_CONV_BEXPR2BE_HASH "bcbh"
00176
00182 #define ST_BMC_TABLEAU_LTL_HASH "btlh"
00183
00184 extern cmp_struct_ptr cmps;
00185 extern FsmBuilder_ptr global_fsm_builder;
00186 extern TraceMgr_ptr global_trace_manager;
00187
00188
00189
00190
00191
00192
00193
00194
00198
00199
00200
00201
00207 node_ptr
00208 bmc_tableau_memoization_get_key(NodeMgr_ptr nodemgr,
00209 node_ptr wff, int time, int k, int l);
00210
00216 void bmc_tableau_memoization_insert(hash_ptr, node_ptr key, be_ptr be);
00217
00223 be_ptr bmc_tableau_memoization_lookup(hash_ptr, node_ptr key);
00224
00231 hash_ptr Bmc_Tableau_get_handled_hash(SymbTable_ptr symb_table,
00232 char* hash_str);
00233
00253 int
00254 Bmc_TestTableau(NuSMVEnv_ptr env, int argc, char ** argv);
00255
00262 void Bmc_TestReset(void);
00263
00269 boolean
00270 isPureFuture(const node_ptr pltl_wff);
00271
00277 be_ptr
00278 Bmc_GetTestTableau(const BeEnc_ptr be_enc,
00279 const node_ptr ltl_wff,
00280 const int k, const int l);
00281
00295 be_ptr
00296 BmcInt_Tableau_GetAtTime(const BeEnc_ptr be_enc,
00297 const node_ptr ltl_wff,
00298 const int time, const int k, const int l);
00299
00300
00301
00302
00310 be_ptr
00311 bmc_tableauGetNextAtTime(const BeEnc_ptr be_enc,
00312 const node_ptr ltl_wff,
00313 const int time, const int k, const int l);
00314
00324 be_ptr
00325 bmc_tableauGetEventuallyAtTime(const BeEnc_ptr be_enc,
00326 const node_ptr ltl_wff,
00327 const int intime, const int k,
00328 const int l);
00329
00338 be_ptr
00339 bmc_tableauGetGloballyAtTime(const BeEnc_ptr be_enc,
00340 const node_ptr ltl_wff,
00341 const int intime, const int k,
00342 const int l);
00343
00352 be_ptr
00353 bmc_tableauGetUntilAtTime(const BeEnc_ptr be_enc,
00354 const node_ptr p, const node_ptr q,
00355 const int time, const int k, const int l);
00356
00366 be_ptr
00367 bmc_tableauGetReleasesAtTime(const BeEnc_ptr be_enc,
00368 const node_ptr p, const node_ptr q,
00369 const int time, const int k, const int l);
00370
00371
00372
00373
00374
00375
00385 be_ptr
00386 Bmc_TableauPLTL_GetTableau(const BeEnc_ptr be_enc,
00387 const node_ptr pltl_wff,
00388 const int k, const int l);
00389
00402 be_ptr
00403 Bmc_TableauPLTL_GetAllTimeTableau(const BeEnc_ptr be_enc,
00404 const node_ptr pltl_wff,
00405 const int k);
00406
00407
00408
00409
00410
00411
00427 lsList
00428 Bmc_Utils_get_vars_list_for_uniqueness(BeEnc_ptr be_enc,
00429 Prop_ptr invarprop);
00430
00446 lsList
00447 Bmc_Utils_get_vars_list_for_uniqueness_fsm(BeEnc_ptr be_enc,
00448 SexpFsm_ptr bool_fsm);
00449
00450
00451
00452 void bmc_simulate_set_curr_sim_trace(const NuSMVEnv_ptr env, Trace_ptr trace, int idx);
00453 Trace_ptr bmc_simulate_get_curr_sim_trace(const NuSMVEnv_ptr env);
00454 int bmc_simulate_get_curr_sim_trace_index(const NuSMVEnv_ptr env);
00455
00456
00472 Trace_ptr
00473 Bmc_create_trace_from_cnf_model(const BeEnc_ptr be_enc,
00474 const NodeList_ptr symbols,
00475 const char* desc,
00476 const TraceType type,
00477 const Slist_ptr cnf_model,
00478 int k);
00479
00491 Trace_ptr
00492 Bmc_fill_trace_from_cnf_model(const BeEnc_ptr be_enc,
00493 const Slist_ptr cnf_model,
00494 int k, Trace_ptr trace);
00495
00496
00497
00509 void
00510 bmc_trace_utils_complete_trace(Trace_ptr trace,
00511 const BoolEnc_ptr bool_enc);
00512
00518 void
00519 bmc_trace_utils_append_input_state(Trace_ptr trace, BeEnc_ptr be_enc,
00520 const Slist_ptr cnf_model);
00521
00524 #endif