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
00090 #ifndef __NUSMV_CORE_COMPILE_SYMB_TABLE_SYMB_TYPE_H__
00091 #define __NUSMV_CORE_COMPILE_SYMB_TABLE_SYMB_TYPE_H__
00092
00093 #include <stdio.h>
00094
00095 #include "nusmv/core/node/node.h"
00096 #include "nusmv/core/utils/utils.h"
00097 #include "nusmv/core/node/printers/MasterPrinter.h"
00098
00099
00106 typedef struct SymbType_TAG* SymbType_ptr;
00107
00113 #define SYMB_TYPE(x) \
00114 ((SymbType_ptr) x)
00115
00121 #define SYMB_TYPE_CHECK_INSTANCE(x) \
00122 (nusmv_assert(SYMB_TYPE(x) != SYMB_TYPE(NULL)))
00123
00124
00137 #define nullType SYMB_TYPE(NULL)
00138
00139
00148 typedef enum SymbTypeTag_TAG {
00149 SYMB_TYPE_NONE,
00150 SYMB_TYPE_STATEMENT,
00151 SYMB_TYPE_BOOLEAN,
00152 SYMB_TYPE_ENUM,
00153 SYMB_TYPE_INTEGER,
00154 SYMB_TYPE_REAL,
00155 SYMB_TYPE_NFUNCTION,
00156 SYMB_TYPE_CONTINUOUS,
00157 SYMB_TYPE_SIGNED_WORD,
00158 SYMB_TYPE_UNSIGNED_WORD,
00159 SYMB_TYPE_WORDARRAY,
00160 SYMB_TYPE_ARRAY,
00161 SYMB_TYPE_SET_BOOL,
00162 SYMB_TYPE_SET_INT,
00163 SYMB_TYPE_SET_SYMB,
00164 SYMB_TYPE_SET_INT_SYMB,
00165 SYMB_TYPE_INTARRAY,
00166 SYMB_TYPE_ERROR,
00167
00168
00169
00170 } SymbTypeTag;
00171
00172
00173
00174 enum Enum_types{ ENUM_TYPE_PURE_INT,
00175 ENUM_TYPE_PURE_SYMBOLIC,
00176 ENUM_TYPE_INT_SYMBOLIC,
00177 };
00178
00179
00180 #ifdef DEFINED_NFunction_ptr
00181 #else
00182 typedef struct NFunction_TAG* NFunction_ptr;
00183 #define DEFINED_NFunction_ptr 1
00184 #endif
00185
00186
00187
00188
00189
00190
00191
00232 SymbType_ptr SymbType_create(const NuSMVEnv_ptr env,
00233 SymbTypeTag tag, node_ptr body);
00234
00260 SymbType_ptr SymbType_create_array(SymbType_ptr subtype,
00261 int lower_bound,
00262 int upper_bound);
00263
00279 SymbType_ptr SymbType_create_nfunction(const NuSMVEnv_ptr env,
00280 NFunction_ptr nfunction);
00281
00282
00283
00301 SymbType_ptr SymbType_copy(const SymbType_ptr self);
00302
00317 void SymbType_destroy(SymbType_ptr self);
00318
00319
00320
00321
00328 SymbTypeTag SymbType_get_tag(const SymbType_ptr self);
00329
00330
00331
00338 boolean SymbType_is_intarray(const SymbType_ptr self);
00339
00346 boolean SymbType_is_enum(const SymbType_ptr self);
00347
00356 boolean SymbType_is_boolean(const SymbType_ptr self);
00357
00364 boolean SymbType_is_integer(const SymbType_ptr self);
00365
00372 boolean SymbType_is_real(const SymbType_ptr self);
00373
00381 boolean SymbType_is_continuous(const SymbType_ptr self);
00382
00392 boolean SymbType_is_pure_int_enum(const SymbType_ptr self);
00393
00403 boolean SymbType_is_pure_symbolic_enum(const SymbType_ptr self);
00404
00414 boolean SymbType_is_int_symbolic_enum(const SymbType_ptr self);
00415
00425 boolean SymbType_is_word_1(const SymbType_ptr self);
00426
00435 boolean SymbType_is_unsigned_word(const SymbType_ptr self);
00436
00445 boolean SymbType_is_signed_word(const SymbType_ptr self);
00446
00455 boolean SymbType_is_word(const SymbType_ptr self);
00456
00467 boolean SymbType_is_set(const SymbType_ptr self);
00468
00473 boolean SymbType_is_function(const SymbType_ptr self);
00474
00475
00484 boolean SymbType_is_error(const SymbType_ptr self);
00485
00495 boolean SymbType_is_statement(const SymbType_ptr self);
00496
00505 boolean SymbType_is_infinite_precision(const SymbType_ptr self);
00506
00514 boolean SymbType_is_array(const SymbType_ptr self);
00515
00522 boolean SymbType_is_wordarray(const SymbType_ptr self);
00523
00536 int SymbType_calculate_type_size(const SymbType_ptr self);
00537
00545 node_ptr
00546 SymbType_generate_all_word_values(const SymbType_ptr self);
00547
00555 int SymbType_get_word_width(const SymbType_ptr self);
00556
00572 int SymbType_get_word_line_number(const SymbType_ptr self);
00573
00580 int SymbType_get_wordarray_awidth(const SymbType_ptr self);
00581
00588 SymbType_ptr SymbType_get_wordarray_subtype(const SymbType_ptr self);
00589
00601 node_ptr SymbType_get_enum_type_values(const SymbType_ptr self);
00602
00610 NFunction_ptr SymbType_get_nfunction_type(const SymbType_ptr self);
00611
00619 SymbType_ptr SymbType_get_array_subtype(const SymbType_ptr self);
00620
00627 int SymbType_get_array_lower_bound(const SymbType_ptr self);
00628
00635 int SymbType_get_array_upper_bound(const SymbType_ptr self);
00636
00644 SymbType_ptr SymbType_get_intarray_subtype(const SymbType_ptr self);
00645
00658 void SymbType_print(const SymbType_ptr self,
00659 MasterPrinter_ptr printer,
00660 FILE* output_stream);
00661
00681 char* SymbType_sprint(const SymbType_ptr self,
00682 MasterPrinter_ptr printer);
00683
00693 boolean SymbType_is_back_comp(const SymbType_ptr type);
00694
00703 SymbType_ptr
00704 SymbType_get_greater(const SymbType_ptr type1, const SymbType_ptr type2);
00705
00717 SymbType_ptr SymbType_make_set_type(const SymbType_ptr self);
00718
00739 SymbType_ptr SymbType_make_from_set_type(const SymbType_ptr self);
00740
00750 SymbType_ptr SymbType_make_memory_shared(const SymbType_ptr self);
00751
00752
00753
00762 SymbType_ptr
00763 SymbType_convert_right_to_left(SymbType_ptr leftType,
00764 SymbType_ptr rightType);
00765
00774 SymbType_ptr
00775 SymbType_get_minimal_common(SymbType_ptr type1, SymbType_ptr type2);
00776
00783 boolean
00784 SymbType_is_memory_shared(SymbType_ptr self);
00785
00793 boolean
00794 SymbType_equals(SymbType_ptr self, SymbType_ptr oth);
00795
00800 boolean SymbType_is_single_value_enum(const SymbType_ptr self);
00801
00802
00803
00804
00817 node_ptr SymbType_to_node(const SymbType_ptr self,
00818 NodeMgr_ptr nodemgr);
00819
00820
00821
00822 #endif