A New Technique in Graph-to-State-Machine Reduction Proofs

檔案

本條目沒有附加檔案。

至出版者網站查看(DOI) ›

日期

2026-11-25

類型

期刊名稱

Algorithms

卷期與頁次

第 19 卷第 12 期,頁 1035

ISSN

1999-4893

語言

英文

摘要

LALR(1) parsers are obtained by merging every pair of LR(1) states with identical cores, but such merging can introduce reduce–reduce conflicts. A natural alternative is to merge as many similar states as possible while keeping the parser conflict-free. We prove that this minimization problem is NP-hard, by a polynomial-time reduction from graph coloring. Given a graph F with n nodes, we construct a conflict-free LR(1) grammar whose canonical LR(1) machine has O(n3) states. Exactly n of these states can be merged, one for each node of F, and two of them conflict if and only if the corresponding nodes in F are adjacent. Hence F is k-colorable if and only if the machine can be reduced to at most C+k states, where C depends only on n. The construction relies on three devices. Every pair of nodes is encoded in the grammar, adjacent or not. A lookahead terminal is shared exactly when two nodes are adjacent. Filler rules make all mergeable states have identical cores. These devices may be useful in other reductions from graph problems to parser state machines.

所屬典藏

期刊論文
顯示完整詮釋資料 統計資料

引用此條目

Yang, A. N.-C., You, Y.-P., & Yang, W. (2026). A New Technique in Graph-to-State-Machine Reduction Proofs. Algorithms, 19(12), 1035. https://doi.org/10.3390/a19121035

BibTeX RIS

引用文字依 APA 第 7 版格式自動產生,使用前請再核對。

分享