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.
|
|
|
is_label(self,
x)
Return true if x is a label in this semantic representation. |
source code
|
|
|
is_hole(self,
x)
Return true if x is a hole in this semantic representation. |
source code
|
|
|
is_node(self,
x)
Return true if x is a node (label or hole) in this semantic
representation. |
source code
|
|
|
_break_down(self,
usr)
Extract holes, labels, formula fragments and constraints from the
hole semantics underspecified representation (USR). |
source code
|
|
|
|
|
_find_top_hole(self)
Return the hole that will be the top of the formula tree. |
source code
|
|
|
pluggings(self)
Calculate and return all the legal pluggings (mappings of labels to
holes) of this semantics given the constraints. |
source code
|
|
|
_plug_nodes(self,
queue,
potential_labels,
plug_acc,
record)
Plug the nodes in `queue' with the labels in `potential_labels'. |
source code
|
|
|
_plug_hole(self,
hole,
ancestors0,
queue,
potential_labels0,
plug_acc0,
record)
Try all possible ways of plugging a single hole. |
source code
|
|
|
_violates_constraints(self,
label,
ancestors)
Return True if the `label' cannot be placed underneath the holes
given by the set `ancestors' because it would violate the constraints
imposed on it. |
source code
|
|
|
|
|
formula_tree(self,
plugging)
Return the first-order logic formula tree for this underspecified
representation using the plugging given. |
source code
|
|
|
|