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: Make sure that a given plugging is legal.  We recursively go through
  each node and make sure that no constraints are violated.
  We also check that all holes have been filled.
docstr_tok: ["Make","sure","that","a","given","plugging","is","legal",".","We","recursively","go","through","each","node","and","make","sure","that","no","constraints","are","violated",".","We","also","check","that","all","holes","have","been","filled","."]
code: def _sanity_check_plugging(self, plugging, node, ancestors):
      """
      Make sure that a given plugging is legal.  We recursively go through
      each node and make sure that no constraints are violated.
      We also check that all holes have been filled.
      """
      if node in self.holes:
          ancestors = [node] + ancestors
          label = plugging[node]
      else:
          label = node
      assert label in self.labels
      for c in self.constraints:
          if c.lhs == label:
              assert c.rhs in ancestors
      args = self.fragments[label][1]
      for arg in args:
          if self.is_node(arg):
              self._sanity_check_plugging(
                  plugging, arg, [label] + ancestors
              )
  
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 11 for calling the HoleSemantics obj's underlying member method code with example usage: obj._sanity_check_plugging(plugging, node, ancestors) without return types