Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00026 #ifndef SPOT_LTLAST_MULTOP_HH
00027 # define SPOT_LTLAST_MULTOP_HH
00028
00029 #include <vector>
00030 #include <map>
00031 #include <iosfwd>
00032 #include "refformula.hh"
00033
00034 namespace spot
00035 {
00036 namespace ltl
00037 {
00038
00043 class multop : public ref_formula
00044 {
00045 public:
00046 enum type { Or, And };
00047
00049 typedef std::vector<formula*> vec;
00050
00063 static formula* instance(type op, formula* first, formula* second);
00064
00077 static formula* instance(type op, vec* v);
00078
00079 virtual void accept(visitor& v);
00080 virtual void accept(const_visitor& v) const;
00081
00083 unsigned size() const;
00087 const formula* nth(unsigned n) const;
00091 formula* nth(unsigned n);
00092
00094 type op() const;
00096 const char* op_name() const;
00097
00099 virtual std::string dump() const;
00100
00102 static unsigned instance_count();
00103
00105 static std::ostream& dump_instances(std::ostream& os);
00106
00107 protected:
00108 typedef std::pair<type, vec*> pair;
00110 struct paircmp
00111 {
00112 bool
00113 operator () (const pair& p1, const pair& p2) const
00114 {
00115 if (p1.first != p2.first)
00116 return p1.first < p2.first;
00117 return *p1.second < *p2.second;
00118 }
00119 };
00120 typedef std::map<pair, multop*, paircmp> map;
00121 static map instances;
00122
00123 multop(type op, vec* v);
00124 virtual ~multop();
00125
00126 private:
00127 type op_;
00128 vec* children_;
00129 };
00130
00131 }
00132 }
00133
00134 #endif // SPOT_LTLAST_MULTOP_HH