class_docstr: This class holds the broken-down components of a hole semantics, i.e. it
  extracts the holes, labels, logic formula fragments and constraints out of
  a big conjunction of such as produced by the hole semantics grammar.  It
  then provides some operations on the semantics dealing with holes, labels
  and finding legal ways to plug holes with labels.
class_docstr_tok: ["This","class","holds","the","broken-down","components","of","a","hole","semantics",",","i.e",".","it","extracts","the","holes",",","labels",",","logic","formula","fragments","and","constraints","out","of","a","big","conjunction","of","such","as","produced","by","the","hole","semantics","grammar",".","It","then","provides","some","operations","on","the","semantics","dealing","with","holes",",","labels","and","finding","legal","ways","to","plug","holes","with","labels","."]
docstr: Constructor.  `usr' is a ``sem.Expression`` representing an
  Underspecified Representation Structure (USR).  A USR has the following
  special predicates:
  ALL(l,v,n),
  EXISTS(l,v,n),
  AND(l,n,n),
  OR(l,n,n),
  IMP(l,n,n),
  IFF(l,n,n),
  PRED(l,v,n,v[,v]*) where the brackets and star indicate zero or more repetitions,
  LEQ(n,n),
  HOLE(n),
  LABEL(n)
  where l is the label of the node described by the predicate, n is either
  a label or a hole, and v is a variable.
docstr_tok: ["Constructor",".","`","usr","'","is","a","``","sem.Expression","``","representing","an","Underspecified","Representation","Structure","(","USR",")",".","A","USR","has","the","following","special","predicates",":","ALL","(","l",",","v",",","n",")",",","EXISTS","(","l",",","v",",","n",")",",","AND","(","l",",","n",",","n",")",",","OR","(","l",",","n",",","n",")",",","IMP","(","l",",","n",",","n",")",",","IFF","(","l",",","n",",","n",")",",","PRED","(","l",",","v",",","n",",","v","[",",","v","]","*",")","where","the","brackets","and","star","indicate","zero","or","more","repetitions",",","LEQ","(","n",",","n",")",",","HOLE","(","n",")",",","LABEL","(","n",")","where","l","is","the","label","of","the","node","described","by","the","predicate",",","n","is","either","a","label","or","a","hole",",","and","v","is","a","variable","."]
code: def __init__(self, usr):
      """
      Constructor.  `usr' is a ``sem.Expression`` representing an
      Underspecified Representation Structure (USR).  A USR has the following
      special predicates:
      ALL(l,v,n),
      EXISTS(l,v,n),
      AND(l,n,n),
      OR(l,n,n),
      IMP(l,n,n),
      IFF(l,n,n),
      PRED(l,v,n,v[,v]*) where the brackets and star indicate zero or more repetitions,
      LEQ(n,n),
      HOLE(n),
      LABEL(n)
      where l is the label of the node described by the predicate, n is either
      a label or a hole, and v is a variable.
      """
      self.holes = set()
      self.labels = set()
      self.fragments = {}  # mapping of label -> formula fragment
      self.constraints = set()  # set of Constraints
      self._break_down(usr)
      self.top_most_labels = self._find_top_most_labels()
      self.top_hole = self._find_top_hole()
  
imports: from functools import reduce
  from nltk.parse import load_parser
  from nltk.sem.logic import AllExpression, AndExpression, ApplicationExpression, ExistsExpression, IffExpression, ImpExpression, LambdaExpression, NegatedExpression, OrExpression
  from nltk.sem.skolemize import skolemize
label_desc: Use image node_id 1 to create a new HoleSemantics object  with example: obj = HoleSemantics(usr)