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
00023 #ifndef SPOT_LTLAST_AUTOMATOP_HH
00024 # define SPOT_LTLAST_AUTOMATOP_HH
00025
00026 # include <vector>
00027 # include <iosfwd>
00028 # include <map>
00029 # include "nfa.hh"
00030 # include "refformula.hh"
00031
00032 namespace spot
00033 {
00034 namespace ltl
00035 {
00039 class automatop : public ref_formula
00040 {
00041 public:
00043 typedef std::vector<formula*> vec;
00044
00051 static automatop*
00052 instance(const nfa::ptr nfa, vec* v, bool negated);
00053
00054 virtual void accept(visitor& v);
00055 virtual void accept(const_visitor& v) const;
00056
00058 unsigned size() const;
00062 const formula* nth(unsigned n) const;
00066 formula* nth(unsigned n);
00067
00069 const spot::ltl::nfa::ptr get_nfa() const;
00070
00072 bool is_negated() const;
00073
00075 std::string dump() const;
00076
00078 static unsigned instance_count();
00079
00081 static std::ostream& dump_instances(std::ostream& os);
00082
00083
00084 protected:
00085 typedef std::pair<std::pair<nfa::ptr, bool>, vec*> triplet;
00087 struct tripletcmp
00088 {
00089 bool
00090 operator () (const triplet& p1, const triplet& p2) const
00091 {
00092 if (p1.first.first != p2.first.first)
00093 return p1.first.first < p2.first.first;
00094 if (p1.first.second != p2.first.second)
00095 return p1.first.second < p2.first.second;
00096 return *p1.second < *p2.second;
00097 }
00098 };
00099 typedef std::map<triplet, automatop*, tripletcmp> map;
00100 static map instances;
00101
00102 automatop(const nfa::ptr, vec* v, bool negated);
00103 virtual ~automatop();
00104
00105 private:
00106 const nfa::ptr nfa_;
00107 vec* children_;
00108 bool negated_;
00109 };
00110 }
00111 }
00112
00113 #endif // SPOT_LTLAST_AUTOMATOP_HH