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
00029
00040 #ifndef __NUSMV_CORE_ENC_BE_BE_ENC_H__
00041 #define __NUSMV_CORE_ENC_BE_BE_ENC_H__
00042
00043
00044 #include "nusmv/core/enc/base/BoolEncClient.h"
00045 #include "nusmv/core/enc/bool/BoolEnc.h"
00046 #include "nusmv/core/compile/symb_table/SymbTable.h"
00047 #include "nusmv/core/be/be.h"
00048 #include "nusmv/core/node/node.h"
00049
00050 #include "nusmv/core/utils/object.h"
00051 #include "nusmv/core/utils/utils.h"
00052
00059 typedef struct BeEnc_TAG* BeEnc_ptr;
00060
00067 #define BE_ENC(self) \
00068 ((BeEnc_ptr) self)
00069
00075 #define BE_ENC_CHECK_INSTANCE(self) \
00076 (nusmv_assert(BE_ENC(self) != BE_ENC(NULL)))
00077
00088 #define BE_CURRENT_UNTIMED -1
00089
00090
00106 typedef enum BeVarType_TAG {
00107 BE_VAR_TYPE_CURR = 0x1 << 0,
00108 BE_VAR_TYPE_FROZEN = 0x1 << 1,
00109 BE_VAR_TYPE_INPUT = 0x1 << 2,
00110 BE_VAR_TYPE_NEXT = 0x1 << 3,
00111
00112
00113 BE_VAR_TYPE_ALL = BE_VAR_TYPE_CURR | BE_VAR_TYPE_FROZEN |
00114 BE_VAR_TYPE_INPUT | BE_VAR_TYPE_NEXT,
00115
00116 BE_VAR_TYPE_ERROR = 0x1 << 4,
00117 } BeVarType;
00118
00122
00123
00124
00125
00134 BeEnc_ptr BeEnc_create(SymbTable_ptr symb_table,
00135 BoolEnc_ptr bool_enc);
00136
00144 VIRTUAL
00149 void BeEnc_destroy(BeEnc_ptr self);
00150
00151
00152
00164 Be_Manager_ptr BeEnc_get_be_manager(const BeEnc_ptr self);
00165
00175 int BeEnc_get_state_vars_num(const BeEnc_ptr self);
00176
00186 int BeEnc_get_frozen_vars_num(const BeEnc_ptr self);
00187
00197 int BeEnc_get_input_vars_num(const BeEnc_ptr self);
00198
00208 int BeEnc_get_vars_num(const BeEnc_ptr self);
00209
00218 int BeEnc_get_max_time(const BeEnc_ptr self);
00219
00220
00221
00222
00232 be_ptr
00233 BeEnc_name_to_untimed(const BeEnc_ptr self, const node_ptr var_name);
00234
00244 int
00245 BeEnc_name_to_index(const BeEnc_ptr self, const node_ptr name);
00246
00263 be_ptr
00264 BeEnc_name_to_timed(const BeEnc_ptr self,
00265 const node_ptr name, const int time);
00266
00267
00268
00269
00280 node_ptr
00281 BeEnc_index_to_name(const BeEnc_ptr self, const int index);
00282
00292 be_ptr
00293 BeEnc_index_to_var(const BeEnc_ptr self, const int index);
00294
00311 be_ptr
00312 BeEnc_index_to_timed(const BeEnc_ptr self, const int index,
00313 const int time);
00314
00329 int BeEnc_index_to_time(const BeEnc_ptr self, const int index);
00330
00341 int
00342 BeEnc_index_to_untimed_index(const BeEnc_ptr self, const int index);
00343
00344
00345
00356 node_ptr
00357 BeEnc_var_to_name(const BeEnc_ptr self, be_ptr be_var);
00358
00367 int
00368 BeEnc_var_to_index(const BeEnc_ptr self, const be_ptr var);
00369
00385 be_ptr
00386 BeEnc_var_to_timed(const BeEnc_ptr self, const be_ptr var,
00387 const int time);
00388
00399 be_ptr
00400 BeEnc_var_to_untimed(const BeEnc_ptr self, const be_ptr var);
00401
00411 be_ptr
00412 BeEnc_var_curr_to_next(const BeEnc_ptr self, const be_ptr curr);
00413
00423 be_ptr
00424 BeEnc_var_next_to_curr(const BeEnc_ptr self, const be_ptr next);
00425
00426
00427
00428
00438 be_ptr
00439 BeEnc_shift_curr_to_next(BeEnc_ptr self, const be_ptr exp);
00440
00452 be_ptr
00453 BeEnc_untimed_expr_to_timed(BeEnc_ptr self, const be_ptr exp,
00454 const int time);
00455
00465 be_ptr
00466 BeEnc_untimed_expr_to_times(BeEnc_ptr self, const be_ptr exp,
00467 const int ctime,
00468 const int ftime,
00469 const int itime,
00470 const int ntime);
00471
00479 be_ptr
00480 BeEnc_untimed_to_timed_and_interval(BeEnc_ptr self,
00481 const be_ptr exp,
00482 const int from, const int to);
00483
00491 be_ptr
00492 BeEnc_untimed_to_timed_or_interval(BeEnc_ptr self,
00493 const be_ptr exp,
00494 const int from, const int to);
00495
00496
00497
00498
00506 boolean
00507 BeEnc_is_index_state_var(const BeEnc_ptr self, const int index);
00508
00515 boolean
00516 BeEnc_is_index_frozen_var(const BeEnc_ptr self, const int index);
00517
00525 boolean
00526 BeEnc_is_index_input_var(const BeEnc_ptr self, const int index);
00527
00534 boolean
00535 BeEnc_is_index_untimed(const BeEnc_ptr self, const int index);
00536
00544 boolean
00545 BeEnc_is_index_untimed_curr(const BeEnc_ptr self, const int index);
00546
00557 boolean
00558 BeEnc_is_index_untimed_frozen(const BeEnc_ptr self, const int index);
00559
00567 boolean
00568 BeEnc_is_index_untimed_input(const BeEnc_ptr self, const int index);
00569
00577 boolean
00578 BeEnc_is_index_untimed_curr_frozen_input(const BeEnc_ptr self,
00579 const int index);
00580
00588 boolean
00589 BeEnc_is_index_untimed_next(const BeEnc_ptr self, const int index);
00590
00591
00592
00593
00612 int
00613 BeEnc_get_first_untimed_var_index(const BeEnc_ptr self, BeVarType type);
00614
00630 int
00631 BeEnc_get_next_var_index(const BeEnc_ptr self,
00632 int var_index, BeVarType type);
00633
00650 int
00651 BeEnc_get_var_index_with_offset(const BeEnc_ptr self,
00652 int from_index, int offset,
00653 BeVarType type);
00654
00670 boolean
00671 BeEnc_is_var_index_valid(const BeEnc_ptr self, int var_index);
00672
00673
00674
00675
00680 #endif