Class: Propose::Tree::Implication
- Inherits:
-
BinaryOperation
- Object
- Node
- BinaryOperation
- Propose::Tree::Implication
- Defined in:
- lib/propose/tree/implication.rb
Overview
Expresses the concept that the right expression is a logical consequence of the left expression.
Instance Attribute Summary
Attributes inherited from BinaryOperation
Instance Method Summary collapse
- #evaluate(assignment) ⇒ Object
-
#initialize(left, right) ⇒ Implication
constructor
A new instance of Implication.
Methods inherited from BinaryOperation
#==, #children, #inspect, #to_s
Methods inherited from Node
Constructor Details
#initialize(left, right) ⇒ Implication
Returns a new instance of Implication.
5 6 7 |
# File 'lib/propose/tree/implication.rb', line 5 def initialize(left, right) super('→', left, right) end |
Instance Method Details
#evaluate(assignment) ⇒ Object
9 10 11 |
# File 'lib/propose/tree/implication.rb', line 9 def evaluate(assignment) !left.evaluate(assignment) || right.evaluate(assignment) end |