OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::SatisfyingSet Class Reference

#include <Satisfier.h>

+ Inheritance diagram for opencog::SatisfyingSet:
+ Collaboration diagram for opencog::SatisfyingSet:

Public Member Functions

 SatisfyingSet (AtomSpace *as)
 
virtual void set_pattern (const Variables &vars, const Pattern &pat)
 
virtual bool grounding (const std::map< Handle, Handle > &var_soln, const std::map< Handle, Handle > &term_soln)
 
- Public Member Functions inherited from opencog::InitiateSearchCB
 InitiateSearchCB (AtomSpace *)
 
virtual bool initiate_search (PatternMatchEngine *)
 
- Public Member Functions inherited from opencog::PatternMatchCallback
virtual ~PatternMatchCallback ()
 
virtual bool fuzzy_match (const Handle &ph, const Handle &gh)
 
virtual IncomingSet get_incoming_set (const Handle &h)
 
virtual void push (void)
 
virtual void pop (void)
 
- Public Member Functions inherited from opencog::DefaultPatternMatchCB
 DefaultPatternMatchCB (AtomSpace *)
 
virtual bool node_match (const Handle &, const Handle &)
 
virtual bool variable_match (const Handle &, const Handle &)
 
virtual bool link_match (const LinkPtr &, const LinkPtr &)
 
virtual bool post_link_match (const LinkPtr &, const LinkPtr &)
 
virtual bool clause_match (const Handle &, const Handle &)
 
virtual bool optional_clause_match (const Handle &pattrn, const Handle &grnd)
 
virtual bool evaluate_sentence (const Handle &pat, const std::map< Handle, Handle > &gnds)
 
virtual const std::set< Type > & get_connectives (void)
 
bool optionals_present (void)
 

Public Attributes

HandleSeq _varseq
 
HandleSeq _satisfying_set
 

Additional Inherited Members

- Protected Member Functions inherited from opencog::InitiateSearchCB
virtual Handle find_starter (const Handle &, size_t &, Handle &, size_t &)
 
virtual Handle find_thinnest (const HandleSeq &, const std::set< Handle > &, Handle &, size_t &)
 
virtual void find_rarest (const Handle &, Handle &, size_t &)
 
virtual bool neighbor_search (PatternMatchEngine *)
 
virtual bool link_type_search (PatternMatchEngine *)
 
virtual bool variable_search (PatternMatchEngine *)
 
virtual bool no_search (PatternMatchEngine *)
 
- Protected Member Functions inherited from opencog::DefaultPatternMatchCB
bool eval_term (const Handle &pat, const std::map< Handle, Handle > &gnds)
 
bool eval_sentence (const Handle &pat, const std::map< Handle, Handle > &gnds)
 
- Protected Attributes inherited from opencog::InitiateSearchCB
ClassServer_classserver
 
const Variables_variables
 
const Pattern_pattern
 
const VariableTypeMap_type_restrictions
 
const std::set< Handle > * _dynamic
 
Handle _root
 
Handle _starter_term
 
bool _search_fail
 
AtomSpace_as
 
- Protected Attributes inherited from opencog::DefaultPatternMatchCB
ClassServer_classserver
 
const VariableTypeMap_type_restrictions = NULL
 
const std::set< Handle > * _dynamic = NULL
 
bool _have_evaluatables = false
 
AtomSpace _temp_aspace
 
Instantiator _instor
 
std::set< Type_connectives
 
bool _optionals_present = false
 
AtomSpace_as
 

Detailed Description

class SatisfyingSet – pattern matching callback for finding satsifaction.

This class is meant to be used with the pattern matcher. When the pattern matcher calls the callback, it will do so with a particular grounding of the search pattern.

This will record every grounding that is found. Thus, after running, the SatisfyingSet can be examined to see all the groundings that were found.

Definition at line 87 of file Satisfier.h.

Constructor & Destructor Documentation

opencog::SatisfyingSet::SatisfyingSet ( AtomSpace as)
inline

Definition at line 92 of file Satisfier.h.

Member Function Documentation

bool SatisfyingSet::grounding ( const std::map< Handle, Handle > &  var_soln,
const std::map< Handle, Handle > &  term_soln 
)
virtual

Called when a complete grounding for all clauses is found. Should return false to search for more solutions; or return true to terminate search. (Just as in all the other callbacks, a return value of true means that the proposed grounding is acceptable. The engine is designed to halt once an acceptable solution has been found; thus, in order to force it to search for more, a return value of false is needed.)

Note that the callback may be called many times reporting the same result.

Implements opencog::PatternMatchCallback.

Definition at line 43 of file Satisfier.cc.

References _satisfying_set, _varseq, and createLink.

virtual void opencog::SatisfyingSet::set_pattern ( const Variables vars,
const Pattern pat 
)
inlinevirtual

Called before search initiation, to indicate the pattern that will be searched for, and the variables to be grounded during the search.

Reimplemented from opencog::DefaultPatternMatchCB.

Definition at line 97 of file Satisfier.h.

References _varseq, opencog::InitiateSearchCB::set_pattern(), opencog::DefaultPatternMatchCB::set_pattern(), and opencog::Variables::varseq.

Member Data Documentation

HandleSeq opencog::SatisfyingSet::_satisfying_set

Definition at line 95 of file Satisfier.h.

HandleSeq opencog::SatisfyingSet::_varseq

Definition at line 94 of file Satisfier.h.


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