def find_pure_symbol_int_repr(symbols, unknown_clauses):
 all_symbols = set().union(*unknown_clauses)
 found_pos = all_symbols.intersection(symbols)
 found_neg = all_symbols.intersection([(- s) for s in symbols])
 for p in found_pos:
  if ((- p) not in found_neg):
   return (p, True)
 for p in found_neg:
  if ((- p) not in found_pos):
   return ((- p), False)
 return (None, None)

def find_pure_symbol_int_repr ( symbols , unknown_clauses ) : all_symbols = set ( ) . union ( * unknown_clauses ) found_pos = all_symbols . intersection ( symbols ) found_neg = all_symbols . intersection ( [ ( - s ) for s in symbols ] ) for p in found_pos : if ( ( - p ) not in found_neg ) : return ( p , True ) for p in found_neg : if ( ( - p ) not in found_pos ) : return ( ( - p ) , False ) return ( None , None )
same as find_pure_symbol .