class_docstr: This is a prover decorator that completes predicates before proving.
  
  If the assumptions contain "P(A)", then "all x.(P(x) -> (x=A))" is the completion of "P".
  If the assumptions contain "all x.(ostrich(x) -> bird(x))", then "all x.(bird(x) -> ostrich(x))" is the completion of "bird".
  If the assumptions don't contain anything that are "P", then "all x.-P(x)" is the completion of "P".
  
  walk(Socrates)
  Socrates != Bill
  + all x.(walk(x) -> (x=Socrates))
  ----------------
  -walk(Bill)
  
  see(Socrates, John)
  see(John, Mary)
  Socrates != John
  John != Mary
  + all x.all y.(see(x,y) -> ((x=Socrates & y=John) | (x=John & y=Mary)))
  ----------------
  -see(Socrates, Mary)
  
  all x.(ostrich(x) -> bird(x))
  bird(Tweety)
  -ostrich(Sam)
  Sam != Tweety
  + all x.(bird(x) -> (ostrich(x) | x=Tweety))
  + all x.-ostrich(x)
  -------------------
  -bird(Sam)
class_docstr_tok: ["This","is","a","prover","decorator","that","completes","predicates","before","proving",".","If","the","assumptions","contain","``","P","(","A",")","''",",","then","``","all","x",".","(","P","(","x",")","-",">","(","x=A",")",")","''","is","the","completion","of","``","P","''",".","If","the","assumptions","contain","``","all","x",".","(","ostrich","(","x",")","-",">","bird","(","x",")",")","''",",","then","``","all","x",".","(","bird","(","x",")","-",">","ostrich","(","x",")",")","''","is","the","completion","of","``","bird","''",".","If","the","assumptions","do","n't","contain","anything","that","are","``","P","''",",","then","``","all","x.-P","(","x",")","''","is","the","completion","of","``","P","''",".","walk","(","Socrates",")","Socrates","!","=","Bill","+","all","x",".","(","walk","(","x",")","-",">","(","x=Socrates",")",")","--","--","--","--","--","--","--","--","-walk","(","Bill",")","see","(","Socrates",",","John",")","see","(","John",",","Mary",")","Socrates","!","=","John","John","!","=","Mary","+","all","x.all","y",".","(","see","(","x",",","y",")","-",">","(","(","x=Socrates","&","y=John",")","|","(","x=John","&","y=Mary",")",")",")","--","--","--","--","--","--","--","--","-see","(","Socrates",",","Mary",")","all","x",".","(","ostrich","(","x",")","-",">","bird","(","x",")",")","bird","(","Tweety",")","-ostrich","(","Sam",")","Sam","!","=","Tweety","+","all","x",".","(","bird","(","x",")","-",">","(","ostrich","(","x",")","|","x=Tweety",")",")","+","all","x.-ostrich","(","x",")","--","--","--","--","--","--","--","--","--","-","-bird","(","Sam",")"]
code: def _map_predicates(self, expression, predDict):
      if isinstance(expression, ApplicationExpression):
          func, args = expression.uncurry()
          if isinstance(func, AbstractVariableExpression):
              predDict[func].append_sig(tuple(args))
      elif isinstance(expression, AndExpression):
          self._map_predicates(expression.first, predDict)
          self._map_predicates(expression.second, predDict)
      elif isinstance(expression, AllExpression):
          # collect all the universally quantified variables
          sig = [expression.variable]
          term = expression.term
          while isinstance(term, AllExpression):
              sig.append(term.variable)
              term = term.term
          if isinstance(term, ImpExpression):
              if isinstance(
                  term.first, ApplicationExpression
              ) and isinstance(term.second, ApplicationExpression):
                  func1, args1 = term.first.uncurry()
                  func2, args2 = term.second.uncurry()
                  if (
                      isinstance(func1, AbstractVariableExpression)
                      and isinstance(func2, AbstractVariableExpression)
                      and sig == [v.variable for v in args1]
                      and sig == [v.variable for v in args2]
                  ):
                      predDict[func2].append_prop(
                          (tuple(sig), term.first)
                      )
                      predDict[func1].validate_sig_len(sig)
  
imports: from collections import defaultdict
  from functools import reduce
  from nltk.inference.api import Prover, ProverCommandDecorator
  from nltk.inference.prover9 import Prover9, Prover9Command
  from nltk.sem.logic import AbstractVariableExpression, AllExpression, AndExpression, ApplicationExpression, BooleanExpression, EqualityExpression, ExistsExpression, Expression, ImpExpression, NegatedExpression, Variable, VariableExpression, operator, unique_variable
label_desc: Use image node_id 5 for calling the ClosedWorldProver obj's underlying member method code with example usage: obj._map_predicates(expression, predDict) without return types