spot
0.9.1
|
00001 // -*- coding: utf-8 -*- 00002 // Copyright (C) 2009, 2012 Laboratoire de Recherche et Développement 00003 // de l'Epita (LRDE). 00004 // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), 00005 // département Systèmes Répartis Coopératifs (SRC), Université Pierre 00006 // et Marie Curie. 00007 // 00008 // This file is part of Spot, a model checking library. 00009 // 00010 // Spot is free software; you can redistribute it and/or modify it 00011 // under the terms of the GNU General Public License as published by 00012 // the Free Software Foundation; either version 2 of the License, or 00013 // (at your option) any later version. 00014 // 00015 // Spot is distributed in the hope that it will be useful, but WITHOUT 00016 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00017 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 00018 // License for more details. 00019 // 00020 // You should have received a copy of the GNU General Public License 00021 // along with Spot; see the file COPYING. If not, write to the Free 00022 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00023 // 02111-1307, USA. 00024 00027 #ifndef SPOT_LTLAST_ATOMIC_PROP_HH 00028 # define SPOT_LTLAST_ATOMIC_PROP_HH 00029 00030 #include <string> 00031 #include <iosfwd> 00032 #include <map> 00033 #include "refformula.hh" 00034 #include "ltlenv/environment.hh" 00035 00036 namespace spot 00037 { 00038 namespace ltl 00039 { 00040 00043 class atomic_prop : public ref_formula 00044 { 00045 public: 00048 static const atomic_prop* 00049 instance(const std::string& name, environment& env); 00050 00051 virtual void accept(visitor& visitor) const; 00052 00054 const std::string& name() const; 00056 environment& env() const; 00057 00059 virtual std::string dump() const; 00060 00062 static unsigned instance_count(); 00064 static std::ostream& dump_instances(std::ostream& os); 00065 00066 protected: 00067 atomic_prop(const std::string& name, environment& env); 00068 virtual ~atomic_prop(); 00069 00070 typedef std::pair<std::string, environment*> pair; 00071 typedef std::map<pair, const atomic_prop*> map; 00072 static map instances; 00073 00074 private: 00075 std::string name_; 00076 environment* env_; 00077 }; 00078 00079 inline 00080 const atomic_prop* 00081 is_atomic_prop(const formula* f) 00082 { 00083 if (f->kind() != formula::AtomicProp) 00084 return 0; 00085 return static_cast<const atomic_prop*>(f); 00086 } 00087 } 00088 } 00089 00090 #endif // SPOT_LTLAST_ATOMICPROP_HH