class_docstr: NLTK's ``ApplicationExpression`` (which represents function applications like P(x)) has two
  limitations, which we overcome by inheriting from ``ApplicationExpression`` and overriding two
  methods.
  
  Firstly, ``ApplicationExpression`` does not handle the case where P's type involves
  placeholders (R, V, !=, etc.), which are special cases because their return types depend on the
  type of their arguments (x). We override the property ``type`` to redefine the type of the
  application.
  
  Secondly, NLTK's variables only bind to entities, and thus the variable types are 'e' by
  default. We get around this issue by replacing x with X, whose initial type is ANY_TYPE, and
  later gets resolved based on the type signature of the function whose scope the variable
  appears in. This variable binding operation is implemented by overriding ``_set_type`` below.
class_docstr_tok: ["NLTK","'s","``","ApplicationExpression","``","(","which","represents","function","applications","like","P","(","x",")",")","has","two","limitations",",","which","we","overcome","by","inheriting","from","``","ApplicationExpression","``","and","overriding","two","methods",".","Firstly",",","``","ApplicationExpression","``","does","not","handle","the","case","where","P","'s","type","involves","placeholders","(","R",",","V",",","!","=",",","etc",".",")",",","which","are","special","cases","because","their","return","types","depend","on","the","type","of","their","arguments","(","x",")",".","We","override","the","property","``","type","``","to","redefine","the","type","of","the","application",".","Secondly",",","NLTK","'s","variables","only","bind","to","entities",",","and","thus","the","variable","types","are","'","e","'","by","default",".","We","get","around","this","issue","by","replacing","x","with","X",",","whose","initial","type","is","ANY_TYPE",",","and","later","gets","resolved","based","on","the","type","signature","of","the","function","whose","scope","the","variable","appears","in",".","This","variable","binding","operation","is","implemented","by","overriding","``","_set_type","``","below","."]
code: def type(self):
      # This gets called when the tree is being built by ``LogicParser.parse``. So, we do not
      # have access to the type signatures yet. Thus, we need to look at the name of the function
      # to return the type.
      if (
          not unicode(self.function)
          in self._variables_with_placeholders
      ):
          return super(DynamicTypeApplicationExpression, self).type
      if self.function.type == ANY_TYPE:
          return ANY_TYPE
      argument_type = self.argument.type
      return self.function.type.get_application_type(argument_type)
  
imports: from __future__ import absolute_import
  from collections import defaultdict
  from nltk.sem.logic import Expression, ApplicationExpression, ConstantExpression, LogicParser, Variable
  from nltk.sem.logic import Type, BasicType, ComplexType, ANY_TYPE
  from allennlp.common.util import START_SYMBOL
label_desc: Use image node_id 2 for calling the DynamicTypeApplicationExpression obj's underlying member method code with example usage: obj.type() and returns: self, super, ANY_TYPE