arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2110.00776cs.CLcs.CCcs.FLcs.PL
收藏

最小化LR(1)状态机是NP难的

Minimizing LR(1) State Machines is NP-Hard

National Yang-Ming Chiao-Tung University(国立阳明交通大学)

Wuu Yang

摘要:

LR(1)解析是过去50年来广泛研究的焦点。虽然大多数基本的谜团已经解决,但仍有一些隐藏在黑暗的角落。我们遇到的一个是LR(1)状态机的最小化,我们证明了这是NP难的。这是节点着色问题,这是减少到最小化难题。约简使用两种技术:间接约简和增量构造。间接归约意味着要着色的图不直接归约为LR(1)状态机。相反,它被简化为一个上下文无关文法,LR(1)状态机就是从这个文法派生出来的。此外,通过考虑图中的节点一次着色一个,上下文无关文法从用于两节点图的模板上下文无关文法递增地扩展。扩展是通过添加新的语法符号和规则来完成的。最小化LR(1)机可以用来恢复原始图的最小着色。

英文摘要:

LR(1) parsing was a focus of extensive research in the past 50 years. Though most fundamental mysteries have been resolved, a few remain hidden in the dark corners. The one we bumped into is the minimization of the LR(1) state machines, which we prove is NP-hard. It is the node-coloring problem that is reduced to the minimization puzzle. The reduction makes use of two technique: indirect reduction and incremental construction. Indirect reduction means the graph to be colored is not reduced to an LR(1) state machine directly. Instead, it is reduced to a context-free grammar from which an LR(1) state machine is derived. Furthermore, by considering the nodes in the graph to be colored one at a time, the context-free grammar is incrementally extended from a template context-free grammar that is for a two-node graph. The extension is done by adding new grammar symbols and rules. A minimized LR(1) machine can be used to recover a minimum coloring of the original graph.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑