Class: Propose::Tree::Conjunction
- Inherits:
-
BinaryOperation
- Object
- Node
- BinaryOperation
- Propose::Tree::Conjunction
- Defined in:
- lib/propose/tree/conjunction.rb
Overview
A conjunction of two expressions, indicating both are true.
Instance Attribute Summary
Attributes inherited from BinaryOperation
Instance Method Summary collapse
- #evaluate(assignment) ⇒ Object
-
#initialize(left, right) ⇒ Conjunction
constructor
A new instance of Conjunction.
Methods inherited from BinaryOperation
#==, #children, #inspect, #to_s
Methods inherited from Node
Constructor Details
#initialize(left, right) ⇒ Conjunction
Returns a new instance of Conjunction.
4 5 6 |
# File 'lib/propose/tree/conjunction.rb', line 4 def initialize(left, right) super('∧', left, right) end |
Instance Method Details
#evaluate(assignment) ⇒ Object
8 9 10 |
# File 'lib/propose/tree/conjunction.rb', line 8 def evaluate(assignment) left.evaluate(assignment) && right.evaluate(assignment) end |