Go to the documentation of this file.00001 #ifndef wali_EPA_GUARD
00002 #define wali_EPA_GUARD 1
00003
00004
00005
00006
00007
00008
00009 #include "wali/wfa/WFA.hpp"
00010 #include "wali/wfa/epr/FunctionalWeight.hpp"
00011 #include "wali/wfa/epr/FunctionalWeightMaker.hpp"
00012 #include <map>
00013 #include <list>
00014
00015 namespace wali
00016 {
00017 namespace wfa
00018 {
00019 namespace epr
00020 {
00021
00022
00023
00024
00025
00026
00027 class EPA : public WFA {
00028 private:
00029
00030
00031 std::map< Key, unsigned int> bfsOrder;
00032
00033 typedef std::list< std::pair< sem_elem_t, sem_elem_t > > CacheElem;
00034 std::map< Key, CacheElem > errorProjCache;
00035 std::map< Key, walienum::ETag > stateTagMap;
00036 int nCacheHits;
00037
00038 public:
00039
00040 EPA( );
00041
00042 ~EPA();
00043
00044 void clear();
00045
00046 int getCacheHits();
00047
00048 void buildEPA(WFA &post, WFA &pre);
00049
00050
00051 sem_elem_t apply(Key node, sem_elem_t initWeight);
00052
00053
00054
00055 sem_elem_t apply(Key node, sem_elem_t initWeight, int ¬found);
00056
00057 private:
00058
00059
00060 sem_elem_t lookupCache(Key q, sem_elem_t w);
00061
00062
00063 void addToCache(Key q, sem_elem_t w, sem_elem_t res);
00064
00065
00066 void setStateTag(State *s, walienum::ETag et);
00067 walienum::ETag getStateTag(State *s);
00068
00069
00070
00071 void orderStatesBFS();
00072
00073 };
00074
00075 }
00076
00077 }
00078
00079 }
00080
00081 #endif // wali_EPA_GUARD
00082