class Logica::Predicates::Compounds::Disjunction

Public Class Methods

absorbing_element() click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 14
def absorbing_element
  predicate_factory.tautology
end
internal_binary_operation() click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 6
def internal_binary_operation
  :or
end
neutral_element() click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 10
def neutral_element
  predicate_factory.contradiction
end

Public Instance Methods

generalization_of_other?(other) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 35
def generalization_of_other?(other)
  super || predicates.any? { |pred| pred.generalization_of?(other) }
end
or(other) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 23
def or(other)
  other.or_with_disjunction(self)
end
or_with_other(other) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 27
def or_with_other(other)
  with_extra_predicate_first(other)
end
portion_satisfied_by(*arguments) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 39
def portion_satisfied_by(*arguments)
  if satisfied_by?(*arguments)
    self
  else
    portions = predicates.map { |predicate| predicate.portion_satisfied_by(*arguments) }
    predicate_factory.conjunction(portions)
  end
end
remainder_unsatisfied_by(*arguments) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 48
def remainder_unsatisfied_by(*arguments)
  if satisfied_by?(*arguments)
    predicate_factory.contradiction
  else
    remainders = predicates.map { |predicate| predicate.remainder_unsatisfied_by(*arguments) }
    predicate_factory.disjunction(remainders)
  end
end
satisfied_by?(*arguments) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 19
def satisfied_by?(*arguments)
  predicates.any? { |predicate| predicate.satisfied_by?(*arguments) }
end
specialization_of?(other) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 31
def specialization_of?(other)
  other.generalization_of_disjunction?(self)
end

Protected Instance Methods

or_with_disjunction(disjunction) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 59
def or_with_disjunction(disjunction)
  disjunction.with_extra_predicates(predicates)
end

Private Instance Methods

annihilation?(first, second) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 73
def annihilation?(first, second)
  first.exhaustive_with?(second)
end
name() click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 65
def name
  'OR'
end
subsumption?(first, second) click to toggle source
# File lib/logica/predicates/compounds/disjunction.rb, line 69
def subsumption?(first, second)
  first.generalization_of?(second)
end