MADARA
3.1.8
|
A composite node that performs an implication (inference rule) More...
#include <CompositeImpliesNode.h>
Public Member Functions | |
CompositeImpliesNode (logger::Logger &logger, ComponentNode *left, ComponentNode *right) | |
Constructor. More... | |
virtual void | accept (Visitor &visitor) const |
Accepts a visitor subclassed from the Visitor class. More... | |
virtual madara::knowledge::KnowledgeRecord | evaluate (const madara::knowledge::KnowledgeUpdateSettings &settings) |
Evaluates the expression tree. More... | |
virtual madara::knowledge::KnowledgeRecord | item (void) const |
Returns the printable character of the node. More... | |
virtual ComponentNode * | left (void) const |
Returns the left expression. More... | |
virtual madara::knowledge::KnowledgeRecord | prune (bool &can_change) |
Prunes the expression tree of unnecessary nodes. More... | |
virtual ComponentNode * | right (void) const |
Returns the right expression. More... | |
void | set_logger (logger::Logger &logger) |
Sets the logger for printing errors and debugging info. More... | |
Protected Attributes | |
ComponentNode * | left_ |
left expression More... | |
logger::Logger * | logger_ |
handle the context More... | |
ComponentNode * | right_ |
Right expression. More... | |
A composite node that performs an implication (inference rule)
Definition at line 22 of file CompositeImpliesNode.h.
madara::expression::CompositeImpliesNode::CompositeImpliesNode | ( | logger::Logger & | logger, |
ComponentNode * | left, | ||
ComponentNode * | right | ||
) |
Constructor.
logger | the logger to use for printing |
left | left expression |
right | right expression |
Definition at line 18 of file CompositeImpliesNode.cpp.
|
virtual |
Accepts a visitor subclassed from the Visitor class.
visitor | visitor instance to use |
Reimplemented from madara::expression::ComponentNode.
Definition at line 104 of file CompositeImpliesNode.cpp.
|
virtual |
Evaluates the expression tree.
Evaluates the node and its children.
If the left expression is true, then the right expression is evaluated. The right expression's value does not percolate back up.
settings | settings for evaluating the node |
This does not prune any of the expression tree, and is much faster than the prune function
Implements madara::expression::ComponentNode.
Definition at line 89 of file CompositeImpliesNode.cpp.
|
virtual |
Returns the printable character of the node.
Reimplemented from madara::expression::ComponentNode.
Definition at line 26 of file CompositeImpliesNode.cpp.
|
virtualinherited |
Returns the left expression.
Reimplemented from madara::expression::ComponentNode.
Definition at line 27 of file CompositeBinaryNode.cpp.
|
virtual |
Prunes the expression tree of unnecessary nodes.
Prune the tree of unnecessary nodes.
can_change | set to true if variable nodes are contained |
Returns evaluation of the node and sets can_change appropriately. if this node can be changed, that means it shouldn't be pruned.
Implements madara::expression::ComponentNode.
Definition at line 38 of file CompositeImpliesNode.cpp.
|
virtualinherited |
Returns the right expression.
Reimplemented from madara::expression::ComponentNode.
Definition at line 24 of file CompositeUnaryNode.cpp.
|
inherited |
Sets the logger for printing errors and debugging info.
logger | the logger to use |
Definition at line 53 of file ComponentNode.cpp.
|
protectedinherited |
left expression
Definition at line 47 of file CompositeBinaryNode.h.
|
protectedinherited |
handle the context
Definition at line 96 of file ComponentNode.h.
|
protectedinherited |
Right expression.
Definition at line 43 of file CompositeUnaryNode.h.