Class: Propose::Tree::Implication

Inherits:
BinaryOperation show all
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

#left, #operator, #right

Instance Method Summary collapse

Methods inherited from BinaryOperation

#==, #children, #inspect, #to_s

Methods inherited from Node

#children, #literal?

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