A copy of this work was available on the public web and has been preserved in the Wayback Machine. The capture dates from 2022; you can also visit the original URL.
The file type is application/pdf
.
Longest segment of balanced parentheses: an exercise in program inversion in a segment problem
2021
Journal of functional programming
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.
doi:10.1017/s0956796821000253
fatcat:rlcukgczvjgjre7tnbzyv6tpiu