spot
0.8.2
|
00001 // Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement 00002 // de l'Epita (LRDE). 00003 // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 00004 // 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), 00005 // Université Pierre et Marie Curie. 00006 // 00007 // This file is part of Spot, a model checking library. 00008 // 00009 // Spot is free software; you can redistribute it and/or modify it 00010 // under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation; either version 2 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // Spot is distributed in the hope that it will be useful, but WITHOUT 00015 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00016 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 00017 // License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with Spot; see the file COPYING. If not, write to the Free 00021 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00022 // 02111-1307, USA. 00023 00029 #ifndef SPOT_LTLAST_BINOP_HH 00030 # define SPOT_LTLAST_BINOP_HH 00031 00032 #include <map> 00033 #include <iosfwd> 00034 #include "refformula.hh" 00035 00036 namespace spot 00037 { 00038 namespace ltl 00039 { 00040 00043 class binop : public ref_formula 00044 { 00045 public: 00050 enum type { Xor, 00051 Implies, 00052 Equiv, 00053 U, //< until 00054 R, //< release (dual of until) 00055 W, //< weak until 00056 M //< strong release (dual of weak until) 00057 }; 00058 00061 static binop* instance(type op, formula* first, formula* second); 00062 00063 virtual void accept(visitor& v); 00064 virtual void accept(const_visitor& v) const; 00065 00067 const formula* first() const; 00069 formula* first(); 00071 const formula* second() const; 00073 formula* second(); 00074 00076 type op() const; 00078 const char* op_name() const; 00079 00081 virtual std::string dump() const; 00082 00084 static unsigned instance_count(); 00085 00087 static std::ostream& dump_instances(std::ostream& os); 00088 00089 protected: 00090 typedef std::pair<formula*, formula*> pairf; 00091 typedef std::pair<type, pairf> pair; 00092 typedef std::map<pair, binop*> map; 00093 static map instances; 00094 00095 binop(type op, formula* first, formula* second); 00096 virtual ~binop(); 00097 00098 private: 00099 type op_; 00100 formula* first_; 00101 formula* second_; 00102 }; 00103 00104 } 00105 } 00106 00107 #endif // SPOT_LTLAST_BINOP_HH