コード例 #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
ファイル: and_op.py プロジェクト: gustavomonente/Prove-It
 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
ファイル: not_op.py プロジェクト: gustavomonente/Prove-It
 def derive_in_bool(self, assumptions=USE_DEFAULTS):
     '''
     From Not(A) derive [Not(A) in Boolean].
     '''
     return in_bool(self).prove(assumptions=assumptions)