Пример #1
0
 def __init__(self, *operands):
     '''
     Or together any number of operands: A or B or C
     '''
     Operation.__init__(self, Or._operator_, operands)
     # deduce trivial disjunctive equivalances with 0 or 1 operand
     # avoid infinite recursion by storing previously encountered
     # expressions
     if self in Or.trivial_disjunctions:
         return
     operands = self.operands
     if operands.num_entries() == 0:
         Or.trivial_disjunctions.add(self)
         try:
             from proveit.logic.booleans.disjunction import empty_disjunction
         except BaseException:
             pass  # empty_disjunction not initially defined when doing a clean rebuild
     if operands.is_single():
         operand = operands[0]
         try:
             Or.trivial_disjunctions.add(self)
             in_bool(operand).prove(automation=False)
             self.unary_reduction()
         except BaseException:
             pass
Пример #2
0
 def derive_in_bool(self, assumptions=USE_DEFAULTS):
     '''
     From (A and B and ... and Z) derive [(A and B and ... and Z) in Boolean].
     '''
     return in_bool(self).prove(assumptions=assumptions)
Пример #3
0
 def derive_in_bool(self, assumptions=USE_DEFAULTS):
     '''
     From Not(A) derive [Not(A) in Boolean].
     '''
     return in_bool(self).prove(assumptions=assumptions)