class_docstr: ``PlaceholderType`` is a ``ComplexType`` that involves placeholders, and thus its type
  resolution is context sensitive. This is an abstract class for all placeholder types like
  reverse, and, or, argmax, etc.
  
  Note that ANY_TYPE in NLTK's type system doesn't work like a wild card. Once the type of a
  variable gets resolved to a specific type, NLTK changes the type of that variable to that
  specific type. Hence, what NLTK calls "ANY_TYPE", is essentially a "yet-to-be-decided" type.
  This is a problem because we may want the same variable to bind to different types within a
  logical form, and using ANY_TYPE for this purpose will cause a resolution failure. For example
  the count function may apply to both rows and cells in the same logical form, and making count
  of type ``ComplexType(ANY_TYPE, DATE_NUM_TYPE)`` will cause a resolution error. This class lets
  you define ``ComplexType`` s with placeholders that are actually wild cards.
  
  The subclasses of this abstract class need to do three things
  1) Override the property ``_signature`` to define the type signature (this is just the
  signature's string representation and will not affect type inference or checking). You will see
  this signature in action sequences.
  2) Override ``resolve`` to resolve the type appropriately (see the docstring in ``resolve`` for
  more information).
  3) Override ``get_application_type`` which returns the return type when this type is applied as
  a function to an argument of a specified type.  For example, if you defined a reverse type by
  inheriting from this class, ``get_application_type`` gets an argument of type ``<a,b>``, it
  should return ``<b,a>`` .
class_docstr_tok: ["``","PlaceholderType","``","is","a","``","ComplexType","``","that","involves","placeholders",",","and","thus","its","type","resolution","is","context","sensitive",".","This","is","an","abstract","class","for","all","placeholder","types","like","reverse",",","and",",","or",",","argmax",",","etc",".","Note","that","ANY_TYPE","in","NLTK","'s","type","system","does","n't","work","like","a","wild","card",".","Once","the","type","of","a","variable","gets","resolved","to","a","specific","type",",","NLTK","changes","the","type","of","that","variable","to","that","specific","type",".","Hence",",","what","NLTK","calls","``","ANY_TYPE","''",",","is","essentially","a","``","yet-to-be-decided","''","type",".","This","is","a","problem","because","we","may","want","the","same","variable","to","bind","to","different","types","within","a","logical","form",",","and","using","ANY_TYPE","for","this","purpose","will","cause","a","resolution","failure",".","For","example","the","count","function","may","apply","to","both","rows","and","cells","in","the","same","logical","form",",","and","making","count","of","type","``","ComplexType","(","ANY_TYPE",",","DATE_NUM_TYPE",")","``","will","cause","a","resolution","error",".","This","class","lets","you","define","``","ComplexType","``","s","with","placeholders","that","are","actually","wild","cards",".","The","subclasses","of","this","abstract","class","need","to","do","three","things","1",")","Override","the","property","``","_signature","``","to","define","the","type","signature","(","this","is","just","the","signature","'s","string","representation","and","will","not","affect","type","inference","or","checking",")",".","You","will","see","this","signature","in","action","sequences",".","2",")","Override","``","resolve","``","to","resolve","the","type","appropriately","(","see","the","docstring","in","``","resolve","``","for","more","information",")",".","3",")","Override","``","get_application_type","``","which","returns","the","return","type","when","this","type","is","applied","as","a","function","to","an","argument","of","a","specified","type",".","For","example",",","if","you","defined","a","reverse","type","by","inheriting","from","this","class",",","``","get_application_type","``","gets","an","argument","of","type","``","<","a",",","b",">","``",",","it","should","return","``","<","b",",","a",">","``","."]
docstr: This method is central to type inference and checking. When a variable's type is being
  checked, we compare what we know of its type against what is expected of its type by its
  context. The expectation is provided as ``other``. We make sure that there are no
  contradictions between this type and other, and return an updated type which may be more
  specific than the original type.
  
  For example, say this type is of the function variable F in F(cell), and we start out with
  ``<?, d>`` (that is, it takes any type and returns ``d`` ). Now we have already resolved
  cell to be of type ``e`` . Then ``resolve`` gets called with ``other = <e, ?>`` , because
  we know F is a function that took a constant of type ``e`` . When we resolve ``<e, ?>``
  against ``<?, d>`` , there will not be a contradiction, because any type can be
  successfully resolved against ``?`` . Finally we return ``<e, d>`` as the resolved type.
  
  As a counter example, if we are trying to resolve ``<?, d>`` against ``<?, e>`` , the
  resolution fails, and in that case, this method returns ``None`` .
  
  Note that a successful resolution does not imply equality of types because of one of them
  may be ANY_TYPE, and so in the subclasses of this type, we explicitly resolve in both
  directions.
code: def resolve(self, other):
      """
      This method is central to type inference and checking. When a variable's type is being
      checked, we compare what we know of its type against what is expected of its type by its
      context. The expectation is provided as ``other``. We make sure that there are no
      contradictions between this type and other, and return an updated type which may be more
      specific than the original type.
  
      For example, say this type is of the function variable F in F(cell), and we start out with
      ``<?, d>`` (that is, it takes any type and returns ``d`` ). Now we have already resolved
      cell to be of type ``e`` . Then ``resolve`` gets called with ``other = <e, ?>`` , because
      we know F is a function that took a constant of type ``e`` . When we resolve ``<e, ?>``
      against ``<?, d>`` , there will not be a contradiction, because any type can be
      successfully resolved against ``?`` . Finally we return ``<e, d>`` as the resolved type.
  
      As a counter example, if we are trying to resolve ``<?, d>`` against ``<?, e>`` , the
      resolution fails, and in that case, this method returns ``None`` .
  
      Note that a successful resolution does not imply equality of types because of one of them
      may be ANY_TYPE, and so in the subclasses of this type, we explicitly resolve in both
      directions.
      """
      raise NotImplementedError
  
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 1 for calling the PlaceholderType obj's underlying member method code with example usage: obj.resolve(other) without return types