コード例 #1
0
 def _new_args_filter(cls, args):
     newargs = []
     for x in args:
         if isinstance(x, Number) or x in (0, 1):
             newargs.append(True if x else False)
         else:
             newargs.append(x)
     return LatticeOp._new_args_filter(newargs, Or)
コード例 #2
0
ファイル: boolalg.py プロジェクト: Bercio/sympy
 def _new_args_filter(cls, args):
     newargs = []
     for x in args:
         if isinstance(x, Number) or x in (0, 1):
             newargs.append(True if x else False)
         else:
             newargs.append(x)
     return LatticeOp._new_args_filter(newargs, Or)
コード例 #3
0
 def _new_args_filter(cls, args):
     newargs = []
     rel = []
     for x in args:
         if isinstance(x, Number) or x in (0, 1):
             newargs.append(True if x else False)
             continue
         if x.is_Relational:
             c = x.canonical
             if c in rel:
                 continue
             nc = (~c).canonical
             if any(r == nc for r in rel):
                 return [S.true]
             rel.append(c)
         newargs.append(x)
     return LatticeOp._new_args_filter(newargs, Or)
コード例 #4
0
ファイル: boolalg.py プロジェクト: yang603/sympy
 def _new_args_filter(cls, args):
     newargs = []
     rel = []
     for x in args:
         if isinstance(x, Number) or x in (0, 1):
             newargs.append(True if x else False)
             continue
         if x.is_Relational:
             c = x.canonical
             if c in rel:
                 continue
             nc = (~c).canonical
             if any(r == nc for r in rel):
                 return [S.true]
             rel.append(c)
         newargs.append(x)
     return LatticeOp._new_args_filter(newargs, Or)