language.hpp

Go to the documentation of this file.
00001 #ifndef WALI_NWA_QUERY_LANGUAGE_HPP
00002 #define WALI_NWA_QUERY_LANGUAGE_HPP
00003 
00004 #include "opennwa/NwaFwd.hpp"
00005 #include "opennwa/NestedWord.hpp"
00006 
00007 namespace opennwa {
00008     namespace query {
00009 
00010       /// @brief Determines whether word is in the language of the given NWA.
00011       ///
00012       /// @returns true if 'word' is in L(this), and false otherwise.
00013       bool
00014       languageContains(Nwa const & nwa, NestedWord const & word);
00015 
00016 
00017       /**
00018        * @brief tests whether the language of the first NWA is included in the language of 
00019        *        the second NWA
00020        *
00021        * This method tests whether the language of the first NWA is included in the language
00022        * of the second NWA.
00023        *
00024        * @param - first: the proposed subset
00025        * @param - second: the proposed superset
00026        * @return true if the language of the first NWA is included in the language of the 
00027        *          second NWA, false otherwise
00028        *
00029        */
00030       bool
00031       languageSubsetEq(Nwa const & left, Nwa const & right);
00032 
00033 
00034       /**
00035        *
00036        * @brief tests whether the language accepted by this NWA is empty
00037        *
00038        * This method tests whether the language accepted by this NWA is empty.
00039        *
00040        * @return true if the language accepted by this NWA is empty
00041        *
00042        */
00043       bool
00044       languageIsEmpty(Nwa const & nwa);
00045 
00046 
00047       /**
00048        *
00049        * @brief Returns some word accepted by 'nwa', or NULL if there isn't one.
00050        *
00051        * @return A word accepted by 'nwa', or NULL if there isn't one
00052        *
00053        */
00054       extern
00055       ref_ptr<NestedWord>
00056       getSomeAcceptedWord(Nwa const & nwa);
00057 
00058       extern
00059       ref_ptr<NestedWord>
00060       getSomeShortestAcceptedWord(Nwa const & nwa);
00061       
00062 
00063       /**
00064        *
00065        * @brief tests whether the languages of the given NWAs are equal
00066        *
00067        * This method tests the equivalence of the languages accepted by the given NWAs.
00068        *
00069        * @param - first: one of the NWAs whose language to test
00070        * @param - second: one of the NWAs whose language to test
00071        * @return true if the languages accepted by the given NWAs are equal, false otherwise
00072        *
00073        */
00074       bool
00075       languageEquals(Nwa const & first, Nwa const & second);
00076       
00077   }
00078 }
00079 
00080 
00081 // Yo, Emacs!
00082 // Local Variables:
00083 //   c-file-style: "ellemtel"
00084 //   c-basic-offset: 2
00085 // End:
00086 
00087 #endif