Given a string of parentheses, the task is to find a longest consecutive segment that is properly bracketed. We find it an interesting problem because it involves two techniques: the usual approach for solving segment problems, and the converse-of-a-function theorem -- through which we derived an instance of shift-reduce parsing.
翻译:考虑到括号的字符串,我们的任务是找到一个放在适当括号内的最长的连续段。我们发现这是一个有趣的问题,因为它涉及两种技术:解决分段问题的通常方法,和反作用理论 -- -- 我们通过这些方法得出了一种转换-减速分析的例子。