Exemplo n.º 1
0
 def __new__(cls, input):
     output = []
     for item in input:
         for new in disjuncts(item):
             for old in output[:]:
                 if implies(new, old):
                     break
                 elif implies(old, new):
                     output.remove(old)
             else:
                 output.append(new)
     if not output:
         return False
     elif len(output) == 1:
         return output[0]
     return frozenset.__new__(cls, output)
Exemplo n.º 2
0
 def __new__(cls, input):
     output = []
     for item in input:
         for new in disjuncts(item):
             for old in output[:]:
                 if implies(new, old):
                     break
                 elif implies(old, new):
                     output.remove(old)
             else:
                 output.append(new)
     if not output:
         return False
     elif len(output) == 1:
         return output[0]
     return frozenset.__new__(cls, output)
Exemplo n.º 3
0
 def __new__(cls, input):
     output = []
     for new in input:
         for old in output[:]:
             if implies(old, new):
                 break
             elif implies(new, old):
                 output.remove(old)
             elif mutually_exclusive(new, old):
                 return False
         else:
             output.append(new)
     if not output:
         return True
     elif len(output) == 1:
         return output[0]
     return frozenset.__new__(cls, output)
Exemplo n.º 4
0
 def __new__(cls, input):
     output = []
     for new in input:
         for old in output[:]:
             if implies(old, new):
                 break
             elif implies(new, old):
                 output.remove(old)
             elif mutually_exclusive(new, old):
                 return False
         else:
             output.append(new)
     if not output:
         return True
     elif len(output) == 1:
         return output[0]
     return frozenset.__new__(cls, output)