00001 // Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6), 00002 // département Systèmes Répartis Coopératifs (SRC), Université Pierre 00003 // et Marie Curie. 00004 // 00005 // This file is part of Spot, a model checking library. 00006 // 00007 // Spot is free software; you can redistribute it and/or modify it 00008 // under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 2 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // Spot is distributed in the hope that it will be useful, but WITHOUT 00013 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00014 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 00015 // License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with Spot; see the file COPYING. If not, write to the Free 00019 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00020 // 02111-1307, USA. 00021 00022 #ifndef SPOT_IFACE_GSPN_COMMON_HH 00023 # define SPOT_IFACE_GSPN_COMMON_HH 00024 00025 # include <string> 00026 # include <iostream> 00027 # include "ltlast/atomic_prop.hh" 00028 # include "ltlenv/environment.hh" 00029 00030 00031 // Do not include gspnlib.h here, or it will polute the user's 00032 // namespace with internal C symbols. 00033 00034 namespace spot 00035 { 00036 00038 class gspn_exeption 00039 { 00040 public: 00041 gspn_exeption(const std::string& where, int err) 00042 : err_(err), where_(where) 00043 { 00044 } 00045 00046 int 00047 get_err() const 00048 { 00049 return err_; 00050 } 00051 00052 std::string 00053 get_where() const 00054 { 00055 return where_; 00056 } 00057 00058 private: 00059 int err_; 00060 std::string where_; 00061 }; 00062 00063 std::ostream& operator<<(std::ostream& os, const gspn_exeption& e); 00064 00065 class gspn_environment : public ltl::environment 00066 { 00067 public: 00068 gspn_environment(); 00069 ~gspn_environment(); 00070 00073 bool declare(const std::string& prop_str); 00074 00075 virtual ltl::formula* require(const std::string& prop_str); 00076 00078 virtual const std::string& name(); 00079 00080 typedef std::map<const std::string, ltl::atomic_prop*> prop_map; 00081 00083 const prop_map& get_prop_map() const; 00084 00085 private: 00086 prop_map props_; 00087 }; 00088 00089 } 00090 00091 #endif // SPOT_IFACE_GSPN_COMMON_HH