Skip to content

GeFaqRunawayRule1

NedLetcher edited this page Aug 14, 2012 · 5 revisions

Grammar Engineering Frequently Asked Questions

When I try to parse a sentence, the LKB says "probable runaway rule". How do I debug this?

The LKB gives this error when the parse chart gets too big. With grammars the size we're looking at, this only happens when a rule or set of rules can apply recursively. Since the LKB is trying to parse exhaustively (find all parses licensed by the grammar for the input string), it will keep applying the recursive rules, even if it has already found (one or more) spanning parses.

To debug this, you'll need to find the rule that is applying to itself (e.g., a unary rule whose mother and daughter are compatible with each other) and stop the recursion by making the mother and daughter incompatible. If it's a set of rules which are causing the recursion, you'll need to decide which one(s) shouldn't be legitimate daughters of the others and make them incompatible.

To figure out which rules are spinning in this way, after you've tried to parse a sentence and gotten the error, select Parse > Show parse chart from the LKB top menu. If you don't immediately see the recursive chain in the chart, scroll to the right until you do.

Back to the Grammar Engineering FAQ.

Clone this wiki locally