dlvhex  2.5.0
ComfortInterpretation Struct Reference

#include <include/dlvhex2/ComfortPluginInterface.h>

Inheritance diagram for ComfortInterpretation:
Collaboration diagram for ComfortInterpretation:

Public Member Functions

void insert (const ComfortAtom &a)
 Insert atom.
void insert (const ComfortInterpretation &i)
 Insert all atoms from other interpretation.
void remove (const std::set< std::string > &predicates)
 Remove atoms whose predicate matches a string in the given set.
void keep (const std::set< std::string > &predicates)
 Remove atoms whose predicate does not match any string in the given set.
void matchPredicate (const std::string &predicate, ComfortInterpretation &destination) const
 Copy all atoms that match the specified predicate into destination interpretation.
void matchAtom (const ComfortAtom &atom, ComfortInterpretation &destination) const
 Copy all atoms that unify with the specified atom into destination interpretation.
ComfortInterpretation difference (const ComfortInterpretation &subtractThis) const
 Return set difference *this \ subtractThis.
std::ostream & print (std::ostream &o) const
 Print interpretation (using ostream_printable<T>).
bool operator== (const ComfortInterpretation &c2) const
 Check inequality.

Detailed Description

Definition at line 445 of file ComfortPluginInterface.h.


Member Function Documentation

Return set difference *this \ subtractThis.

Parameters:
subtractThisInterpretation to remove from this one.
Returns:
Set difference *this \ subtractThis.

Definition at line 279 of file ComfortPluginInterface.cpp.

Referenced by operator==().

Insert atom.

Parameters:
aAtom to insert.

Definition at line 167 of file ComfortPluginInterface.cpp.

Referenced by insert(), matchAtom(), matchPredicate(), and ComfortPluginAtom::retrieve().

Insert all atoms from other interpretation.

Parameters:
iInterpretation to insert.

Definition at line 174 of file ComfortPluginInterface.cpp.

References insert().

void ComfortInterpretation::keep ( const std::set< std::string > &  predicates)

Remove atoms whose predicate does not match any string in the given set.

Parameters:
predicatesPredicates to search for.

Definition at line 224 of file ComfortPluginInterface.cpp.

References ComfortTerm::createConstant().

void ComfortInterpretation::matchAtom ( const ComfortAtom atom,
ComfortInterpretation destination 
) const

Copy all atoms that unify with the specified atom into destination interpretation.

Parameters:
atomAtom to search for.
destinationTarget ComfortInterpretation to receive the result.

Definition at line 265 of file ComfortPluginInterface.cpp.

References insert().

void ComfortInterpretation::matchPredicate ( const std::string &  predicate,
ComfortInterpretation destination 
) const

Copy all atoms that match the specified predicate into destination interpretation.

Parameters:
predicatesPredicates to search for.
destinationTarget ComfortInterpretation to receive the result.

Definition at line 249 of file ComfortPluginInterface.cpp.

References ComfortTerm::createConstant(), and insert().

Referenced by TestCAtom::retrieve(), and TestSetMinusAtom::retrieve().

bool ComfortInterpretation::operator== ( const ComfortInterpretation c2) const

Check inequality.

Parameters:
c2Interpretation to compare to.
Returns:
True if this interpretation is equal to c2 and false otherwise.

Definition at line 297 of file ComfortPluginInterface.cpp.

References difference().

std::ostream & ComfortInterpretation::print ( std::ostream &  o) const

Print interpretation (using ostream_printable<T>).

Non-virtual on purpose. (see Printhelpers.h)

Parameters:
oStream to print to.
Returns:
o.

Definition at line 291 of file ComfortPluginInterface.cpp.

References printrange().

void ComfortInterpretation::remove ( const std::set< std::string > &  predicates)

Remove atoms whose predicate matches a string in the given set.

Parameters:
predicatesPredicates to search for.

Definition at line 199 of file ComfortPluginInterface.cpp.

References ComfortTerm::createConstant().


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