dlvhex  2.5.0
DLVResultParser Class Reference

Parses DLV answer sets. More...

#include <include/dlvhex2/DLVresultParserDriver.h>

Public Types

enum  ParseMode { FirstOrder, HO }
 Tells the parser how to postprocess the answer-set. More...
typedef boost::function< void(AnswerSet::Ptr)> AnswerSetAdder

Public Member Functions

 DLVResultParser (RegistryPtr reg)
 Constructor.
 DLVResultParser (RegistryPtr reg, ParseMode mode)
 Constructor.
virtual ~DLVResultParser ()
 Destructor.
void setParseMode (ParseMode mode)
 This function changes the parse mode of this instance.
void parse (std::istream &is, AnswerSetAdder answerSetAdder) throw (SyntaxError)
 This function parses input, registers newly parsed atoms if necessary, sets parsed atoms to true in the interpretation of the answer set sets weak weights if present in the answer set.

Protected Attributes

RegistryPtr reg
 Registry.
ParseMode pMode
 See DLVResultParser::ParseMode.

Detailed Description

Parses DLV answer sets.

Definition at line 54 of file DLVresultParserDriver.h.


Member Typedef Documentation

typedef boost::function<void (AnswerSet::Ptr)> DLVResultParser::AnswerSetAdder

Definition at line 71 of file DLVresultParserDriver.h.


Member Enumeration Documentation

Tells the parser how to postprocess the answer-set.

Default is FirstOrder.

Enumerator:
FirstOrder 

Will take atoms just as they are.

HO 

Assumes that the elements of the answer-set are higher-order atoms of kind: "a_2(p, x, y)" (where 2 is the arity).

The parser will just ignore the predicate name (a_2) and use it's first parameter as new predicate, i.e. "a_2(p, x, y)" is transformed into "p(x, y)".

Definition at line 60 of file DLVresultParserDriver.h.


Constructor & Destructor Documentation

Constructor.

Parameters:
regSee DLVResultParser::reg.

Definition at line 88 of file DLVresultParserDriver.cpp.

Constructor.

Parameters:
regSee DLVResultParser::reg.
modeSee DLVResultParser::mode.

Definition at line 95 of file DLVresultParserDriver.cpp.

Destructor.

Definition at line 102 of file DLVresultParserDriver.cpp.


Member Function Documentation

void DLVResultParser::parse ( std::istream &  is,
AnswerSetAdder  answerSetAdder 
) throw (SyntaxError)

This function parses input, registers newly parsed atoms if necessary, sets parsed atoms to true in the interpretation of the answer set sets weak weights if present in the answer set.

Parameters:
isInput.
answerSetAdderContainer where parsed answer sets are to be added.

Definition at line 362 of file DLVresultParserDriver.cpp.

References DBGLOG, DLVHEX_BENCHMARK_REGISTER_AND_SCOPE, HO, and LOG.

This function changes the parse mode of this instance.

Parameters:
modeSee DLVResultParser::ParseMode.

Definition at line 108 of file DLVresultParserDriver.cpp.

References pMode.


Field Documentation

See DLVResultParser::ParseMode.

Default is FirstOrder.

Definition at line 77 of file DLVresultParserDriver.h.

Referenced by setParseMode().

Registry.

Definition at line 75 of file DLVresultParserDriver.h.


The documentation for this class was generated from the following files: