00001
00005 #ifndef DIVINE_SYSTEM_HH
00006 #define DIVINE_SYSTEM_HH
00007
00008 #ifndef DOXYGEN_PROCESSING
00009 #include <fstream>
00010 #include "common/array.hh"
00011 #include "common/error.hh"
00012 #include "system/system_abilities.hh"
00013 #include "system/data.hh"
00014 #include "system/transition.hh"
00015 #include "system/process.hh"
00016 #include "system/state.hh"
00017
00018
00019 namespace divine {
00020 #endif //DOXYGEN_PROCESSING
00021
00022
00023
00024 enum property_type_t {NONE, BUCHI, GENBUCHI, MULLER, RABIN, STREETT};
00025
00026 class transition_t;
00027 class process_t;
00028 class process_decomposition_t;
00029
00031
00038 class system_t
00039 {
00040 protected:
00041 error_vector_t & terr;
00042
00043 system_abilities_t abilities;
00044 bool with_property;
00045
00046 void copy_private_part(const system_t & second)
00047 {
00048 abilities = second.abilities;
00049 with_property = second.with_property;
00050 }
00051
00052 public:
00053 static const ERR_type_t ERR_TYPE_SYSTEM;
00054 static const ERR_id_t ERR_FILE_NOT_OPEN;
00055
00057
00060 system_t(error_vector_t & evect = gerr):terr(evect)
00061 {
00062
00063 with_property = false;
00064 };
00066 virtual ~system_t() {};
00068 error_vector_t & get_error_vector() { return terr; }
00070 const error_vector_t & get_error_vector() const { return terr; }
00072
00074 system_abilities_t & get_abilities() { return abilities; }
00076
00078 const system_abilities_t & get_abilities() const { return abilities; }
00079
00081 void set_with_property(const bool is_with) { with_property=is_with; }
00082
00084 bool get_with_property() const { return (with_property); }
00085
00089
00090
00091 virtual property_type_t get_property_type() = 0;
00092
00094
00098 virtual slong_int_t read(std::istream & ins = std::cin) = 0;
00100
00106 virtual slong_int_t read(const char * const filename) = 0;
00108
00112 virtual slong_int_t from_string(const std::string str) = 0;
00114
00116 virtual bool write(const char * const filename) = 0;
00119 virtual void write(std::ostream & outs = std::cout) = 0;
00122 virtual std::string to_string() = 0;
00125
00126 bool can_property_process() const
00127 { return abilities.system_can_property_process; }
00128
00134
00135
00136 virtual process_t * get_property_process() = 0;
00137
00139
00140 virtual const process_t * get_property_process() const = 0;
00141
00143
00144 virtual size_int_t get_property_gid() const = 0;
00145
00147
00150 virtual void set_property_gid(const size_int_t gid) = 0;
00151
00156
00157 bool can_decompose_property() const { return abilities.system_can_decompose_property; }
00158
00162
00163 virtual process_decomposition_t *get_property_decomposition()
00164 {
00165 return 0;
00166 }
00169
00170 bool can_processes() const { return abilities.system_can_processes; }
00171
00177
00178
00180 virtual size_int_t get_process_count() const = 0;
00182
00188 virtual process_t * get_process(const size_int_t gid) = 0;
00190
00196 virtual const process_t * get_process(const size_int_t gid) const = 0;
00197
00200
00201 bool can_transitions() const { return abilities.system_can_transitions; }
00202
00207
00208
00211 virtual size_int_t get_trans_count() const = 0;
00213
00214 virtual transition_t * get_transition(size_int_t gid) = 0;
00216
00217 virtual const transition_t * get_transition(size_int_t gid) const = 0;
00218
00221
00222
00224 bool can_be_modified() const { return abilities.system_can_be_modified; }
00225
00230
00231
00232 virtual void add_process(process_t * const process) = 0;
00234
00235 virtual void remove_process(const size_int_t process_id) = 0;
00236
00238 };
00239
00240 #ifndef DOXYGEN_PROCESSING
00241 }
00242 #endif //DOXYGEN_PROCESSING
00243
00244 #endif
00245