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)
 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)