parameters: (lit)
return_statement: return Literal(lit.polarity,Atom(lit.atom.relname,terms))
docstring: rename variables to constants in a canonical way.
  
      >>> canonize_literal(to_literal('p(t,X,Y)'))
      p(t, V1, V2)
      >>> canonize_literal(to_literal('~p(t,X,X)'))
      ~p(t, V1, V1)
docstring_summary: rename variables to constants in a canonical way.
docstring_tokens: rename variables to constants in a canonical way .
function: def canonize_literal_unique(lit):
      """ 
      rename variables to constants in a canonical way.
  
      >>> canonize_literal(to_literal('p(t,X,Y)'))
      p(t, V1, V2)
      >>> canonize_literal(to_literal('~p(t,X,X)'))
      ~p(t, V1, V1)
      """
  
      subs = dict()
      terms = []
      for i,t in enumerate(lit.atom.args):
          if isinstance(t,Variable):
              if t.rep not in subs:
                  subs[t.rep] = Variable("W" + str(i),t.sort)
              terms.append(subs[t.rep])
          else:
              terms.append(t)
      return Literal(lit.polarity,Atom(lit.atom.relname,terms))
function_tokens: def canonize_literal_unique ( lit ) : subs = dict ( ) terms = [ ] for i , t in enumerate ( lit . atom . args ) : if isinstance ( t , Variable ) : if t . rep not in subs : subs [ t . rep ] = Variable ( "W" + str ( i ) , t . sort ) terms . append ( subs [ t . rep ] ) else : terms . append ( t ) return Literal ( lit . polarity , Atom ( lit . atom . relname , terms ) )