class Logica::Predicates::Compounds::Conjunction
Public Class Methods
absorbing_element()
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 14 def absorbing_element predicate_factory.contradiction end
internal_binary_operation()
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 6 def internal_binary_operation :and end
neutral_element()
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 10 def neutral_element predicate_factory.tautology end
Public Instance Methods
and(other)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 23 def and(other) other.and_with_conjunction(self) end
and_with_other(other)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 27 def and_with_other(other) with_extra_predicate_first(other) end
portion_satisfied_by(*arguments)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 40 def portion_satisfied_by(*arguments) satisfied_predicates = predicates_satisfied_by(*arguments) predicate_factory.conjunction(satisfied_predicates) end
remainder_unsatisfied_by(*arguments)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 45 def remainder_unsatisfied_by(*arguments) unsatisfied_predicates = predicates_unsatisfied_by(*arguments) if unsatisfied_predicates.empty? predicate_factory.contradiction else predicate_factory.conjunction(unsatisfied_predicates) end end
satisfied_by?(*arguments)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 19 def satisfied_by?(*arguments) predicates.all? { |predicate| predicate.satisfied_by?(*arguments) } end
specialization_of?(other)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 31 def specialization_of?(other) other.generalization_of_conjunction?(self) end
specialization_of_other?(other)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 35 def specialization_of_other?(other) other.generalization_of_other?(self) || predicates.any? { |pred| pred.specialization_of?(other) } end
Protected Instance Methods
and_with_conjunction(conjunction)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 56 def and_with_conjunction(conjunction) conjunction.with_extra_predicates(predicates) end
Private Instance Methods
annihilation?(first, second)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 70 def annihilation?(first, second) first.disjoint_with?(second) end
name()
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 62 def name 'AND' end
subsumption?(first, second)
click to toggle source
# File lib/logica/predicates/compounds/conjunction.rb, line 66 def subsumption?(first, second) first.specialization_of?(second) end