Open davidweichiang opened 2 years ago
As mentioned in #140, this will eventually also make it possible to use FGG.new_rule
to create and add an empty rule to the grammar and then add nodes and edges to the rule.
Possible objections:
edge_labels is going to be much bigger than before, which could be slower. Indeed factorize_hrg
became much slower so I had to fix it.
There is no mechanism for removing an entry from edge_labels if all the edges that use a label are removed. This has always been an issue, but now it could be worse: imagine adding an edge labeled el1 to rule1, removing it, then adding an edge labeled el2 to rule2 in the same grammar, and el1 and el2 are conflicting.
OK to merge this one?
@darcey Can we discuss this one?
This lets all the rules of an HRG share a single edge_labels registry (as suggested in #140), which makes it possible to catch errors like adding an edge to a rule rhs whose label clashes with one from another rule.