SemElemPair.hpp

Go to the documentation of this file.
00001 #ifndef wali_SEMELEM_PAIR_GUARD
00002 #define wali_SEMELEM_PAIR_GUARD 1
00003 
00004 /**
00005  * @author Nicholas Kidd
00006  */
00007 
00008 #include "wali/Common.hpp"
00009 #include "wali/SemElem.hpp"
00010 
00011 namespace wali
00012 {
00013   class SemElemPair : public SemElem
00014   {
00015     public:
00016       SemElemPair( SemElem* fst, SemElem* snd );
00017 
00018       SemElemPair( sem_elem_t fst, sem_elem_t snd );
00019 
00020       virtual ~SemElemPair();
00021 
00022       /** @brief return the One element of the semiring */
00023       virtual sem_elem_t one() const;
00024 
00025       /** @brief return the Zero element of the semiring */
00026       virtual sem_elem_t zero() const;
00027 
00028       /** @brief Perform the extend operation */
00029       virtual sem_elem_t extend( SemElem * se );
00030 
00031       /** @brief Perform the combine operation */
00032       virtual sem_elem_t combine( SemElem * se );
00033 
00034       /** @brief Equality comparison between two semiring elements */
00035       virtual bool equal( SemElem * se ) const;
00036 
00037       /** @brief Print the semiring element to the std::ostream o */
00038       virtual std::ostream& print( std::ostream & o ) const;
00039 
00040       /** @brief Perform the diff operation */
00041       virtual sem_elem_t diff( SemElem * se );
00042 
00043       /** @brief Perform the quasi_one operation */
00044       virtual sem_elem_t quasi_one() const;
00045 
00046       /** @brief Perform the delta operation */
00047       virtual std::pair<sem_elem_t,sem_elem_t> delta( SemElem * se );
00048 
00049       /** @brief return first element */
00050       sem_elem_t get_first() const {
00051         return first; 
00052       }
00053 
00054       /** @brief return second element */
00055       sem_elem_t get_second() const {
00056         return second; 
00057       } 
00058 
00059     protected:
00060       sem_elem_t first;
00061       sem_elem_t second;
00062 
00063   }; // class SemElemPair
00064 
00065 } // namespace
00066 
00067 #endif  // wali_SEMELEM_PAIR_GUARD
00068