Semantic conflict freedom for LR(k) grammars #
This file packages the two direct consequences of Knuth's handle-uniqueness
condition needed by a deterministic bottom-up parser. A reduction candidate
is a handle ending at the current prefix. A later-handle candidate witnesses
that the handle ending in the same right-sentential form lies strictly to the
right of that prefix. CoreIsLRk makes reductions unique and rules out a
reduction/later-handle conflict at equal lookahead.
A production is reducible at gamma with padded lookahead u when a
rightmost derivation has reached its left-hand nonterminal and applying the
production ends exactly at gamma.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A handle lies genuinely later than gamma in a right-sentential form
whose terminal suffix has padded lookahead u. The displayed terminal a
is the first grammar symbol beyond gamma; retaining it makes strictness
structural rather than an inequality on lengths.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Two reductions enabled at the same prefix and lookahead use the same production (and, internally, the same handle position).
An LR(k) reduction cannot coexist with a handle ending strictly later in
the same right-sentential form at the same lookahead. This is the semantic
shift/reduce-conflict theorem; unlike reduce/reduce uniqueness, it uses the
full sentential-form equality in CoreIsLRk.