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