dlvhex  2.5.0
include/dlvhex2/MLPSyntaxChecker.h
Go to the documentation of this file.
00001 
00009 #if !defined(_DLVHEX_MLPSYNTAXCHECKER_H)
00010 #define _DLVHEX_MLPSYNTAXCHECKER_H
00011 
00012 #include "dlvhex2/ID.h"
00013 #include "dlvhex2/Interpretation.h"
00014 #include "dlvhex2/Registry.h"
00015 #include "dlvhex2/ProgramCtx.h"
00016 //#include "dlvhex2/ModuleTable.hpp"
00017 
00018 #include <boost/multi_index_container.hpp>
00019 #include <boost/multi_index/member.hpp>
00020 #include <boost/multi_index/ordered_index.hpp>
00021 #include <boost/multi_index/sequenced_index.hpp>
00022 #include <boost/multi_index/identity.hpp>
00023 #include <iostream>
00024 #include <iterator>
00025 #include <string>
00026 
00027 DLVHEX_NAMESPACE_BEGIN
00028 
00030 class DLVHEX_EXPORT MLPSyntaxChecker
00031 {
00032     private:
00034         ProgramCtx ctx;
00038         int getArity(std::string predName);
00042         int getArity(ID idp);
00046         std::string getStringBeforeSeparator(const std::string& s);
00050         std::string getStringAfterSeparator(const std::string& s);
00055         bool verifyPredInputsArityModuleCall(ID module, Tuple tuple);
00060         bool verifyPredOutputArityModuleCall(ID module, ID outputpredicate);
00063         bool verifyAllModuleCalls();
00064 
00065     public:
00068         MLPSyntaxChecker(ProgramCtx& ctx1);
00071         bool verifySyntax();
00072 };
00073 
00074 DLVHEX_NAMESPACE_END
00075 #endif                           /* _DLVHEX_MLPSYNTAXCHECKER_H */
00076 
00077 // vim:expandtab:ts=4:sw=4:
00078 // mode: C++
00079 // End: