一句话:通过程序反转与段问题技术,线性时间求最长平衡括号段,并推导出移进-归约解析实例。
论文研究如何在线性时间内找出给定括号串中最长的连续平衡段。作者将该问题视为一个段问题(segment problem),结合求解段问题的常用方法与一个用于构造函数逆的定理,对相关函数进行程序反转,从而系统性地推导出算法。该推导过程产生了一个 shift-reduce parsing 的实例,说明程序反转可用于从问题规约获得有效解析过程。摘要强调该问题的有趣之处在于技术组合,而非提出全新复杂度下界;其关键结果是得到线性时间算法,并展示逆函数构造定理在段问题中的应用。
Abstract Given a string of parentheses, the task is to find the longest consecutive segment that is balanced, in linear time. We find this problem interesting because it involves a combination of techniques: the usual approach for solving segment problems and a theorem for constructing the inverse of a function—through which we derive an instance of shift-reduce parsing.
@article{paperbot1242,
title = {Longest segment of balanced parentheses: an exercise in program inversion in a segment problem},
author = {SHIN-CHENG MU and TSUNG-JU CHIANG},
journal = {Journal of Functional Programming},
volume = {31},
year = {2021},
doi = {10.1017/s0956796821000253}
}