Longest segment of balanced parentheses: an exercise in program inversion in a segment problem

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 funct...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Journal of functional programming 2021-01, Vol.31, Article e31
Hauptverfasser: MU, SHIN-CHENG, CHIANG, TSUNG-JU
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
container_end_page
container_issue
container_start_page
container_title Journal of functional programming
container_volume 31
creator MU, SHIN-CHENG
CHIANG, TSUNG-JU
description 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_str_mv 10.1017/S0956796821000253
format Article
fullrecord <record><control><sourceid>proquest_cross</sourceid><recordid>TN_cdi_proquest_journals_2601780320</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><cupid>10_1017_S0956796821000253</cupid><sourcerecordid>2601780320</sourcerecordid><originalsourceid>FETCH-LOGICAL-c269t-27bd4d451017f731d758660e49592bcec39bc05717abfcb2cc4566d5832c453f3</originalsourceid><addsrcrecordid>eNp1UEtLxDAQDqJgXf0B3gKeq3k0SeNNFl2FBQ_q1ZKk09qlTddkV_Tfm7KLHsTTDPO9-Aahc0ouKaHq6oloIZWWJaOEECb4AcpoIXWupOCHKJvgfMKP0UmMq8QpmSgz9LocfQtxgyO0A_gNHhtsTW-8gxqvTUinN4gQr7HxGD4huC4C7jxeh7ENZkjrB4TYjX46mh-bBNsehlN01Jg-wtl-ztDL3e3z_D5fPi4e5jfL3DGpNzlTti7qQkxVGsVprUQpJYFCC82sA8e1dUQoqoxtnGXOFULKWpScpY03fIYudr4p932b-lSrcRt8iqyYTKYl4YwkFt2xXBhjDNBU69ANJnxVlFRTdvXnjUnD9xoz2NDVLfxa_6_6BprfdFo</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype><pqid>2601780320</pqid></control><display><type>article</type><title>Longest segment of balanced parentheses: an exercise in program inversion in a segment problem</title><source>EZB-FREE-00999 freely available EZB journals</source><creator>MU, SHIN-CHENG ; CHIANG, TSUNG-JU</creator><creatorcontrib>MU, SHIN-CHENG ; CHIANG, TSUNG-JU</creatorcontrib><description>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.</description><identifier>ISSN: 0956-7968</identifier><identifier>EISSN: 1469-7653</identifier><identifier>DOI: 10.1017/S0956796821000253</identifier><language>eng</language><publisher>Cambridge, UK: Cambridge University Press</publisher><subject>Functional Pearl ; Segments</subject><ispartof>Journal of functional programming, 2021-01, Vol.31, Article e31</ispartof><rights>The Author(s), 2021. Published by Cambridge University Press</rights><lds50>peer_reviewed</lds50><woscitedreferencessubscribed>false</woscitedreferencessubscribed><cites>FETCH-LOGICAL-c269t-27bd4d451017f731d758660e49592bcec39bc05717abfcb2cc4566d5832c453f3</cites><orcidid>0000-0002-4755-601X</orcidid></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>314,776,780,27901,27902</link.rule.ids></links><search><creatorcontrib>MU, SHIN-CHENG</creatorcontrib><creatorcontrib>CHIANG, TSUNG-JU</creatorcontrib><title>Longest segment of balanced parentheses: an exercise in program inversion in a segment problem</title><title>Journal of functional programming</title><addtitle>J. Funct. Prog</addtitle><description>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.</description><subject>Functional Pearl</subject><subject>Segments</subject><issn>0956-7968</issn><issn>1469-7653</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2021</creationdate><recordtype>article</recordtype><sourceid>BENPR</sourceid><recordid>eNp1UEtLxDAQDqJgXf0B3gKeq3k0SeNNFl2FBQ_q1ZKk09qlTddkV_Tfm7KLHsTTDPO9-Aahc0ouKaHq6oloIZWWJaOEECb4AcpoIXWupOCHKJvgfMKP0UmMq8QpmSgz9LocfQtxgyO0A_gNHhtsTW-8gxqvTUinN4gQr7HxGD4huC4C7jxeh7ENZkjrB4TYjX46mh-bBNsehlN01Jg-wtl-ztDL3e3z_D5fPi4e5jfL3DGpNzlTti7qQkxVGsVprUQpJYFCC82sA8e1dUQoqoxtnGXOFULKWpScpY03fIYudr4p932b-lSrcRt8iqyYTKYl4YwkFt2xXBhjDNBU69ANJnxVlFRTdvXnjUnD9xoz2NDVLfxa_6_6BprfdFo</recordid><startdate>20210101</startdate><enddate>20210101</enddate><creator>MU, SHIN-CHENG</creator><creator>CHIANG, TSUNG-JU</creator><general>Cambridge University Press</general><scope>AAYXX</scope><scope>CITATION</scope><scope>3V.</scope><scope>7SC</scope><scope>7XB</scope><scope>8AL</scope><scope>8FD</scope><scope>8FE</scope><scope>8FG</scope><scope>8FK</scope><scope>ABUWG</scope><scope>AFKRA</scope><scope>ARAPS</scope><scope>AZQEC</scope><scope>BENPR</scope><scope>BGLVJ</scope><scope>CCPQU</scope><scope>DWQXO</scope><scope>GNUQQ</scope><scope>HCIFZ</scope><scope>JQ2</scope><scope>K7-</scope><scope>L7M</scope><scope>L~C</scope><scope>L~D</scope><scope>M0N</scope><scope>P5Z</scope><scope>P62</scope><scope>PQEST</scope><scope>PQQKQ</scope><scope>PQUKI</scope><scope>Q9U</scope><orcidid>https://orcid.org/0000-0002-4755-601X</orcidid></search><sort><creationdate>20210101</creationdate><title>Longest segment of balanced parentheses: an exercise in program inversion in a segment problem</title><author>MU, SHIN-CHENG ; CHIANG, TSUNG-JU</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-c269t-27bd4d451017f731d758660e49592bcec39bc05717abfcb2cc4566d5832c453f3</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2021</creationdate><topic>Functional Pearl</topic><topic>Segments</topic><toplevel>peer_reviewed</toplevel><toplevel>online_resources</toplevel><creatorcontrib>MU, SHIN-CHENG</creatorcontrib><creatorcontrib>CHIANG, TSUNG-JU</creatorcontrib><collection>CrossRef</collection><collection>ProQuest Central (Corporate)</collection><collection>Computer and Information Systems Abstracts</collection><collection>ProQuest Central (purchase pre-March 2016)</collection><collection>Computing Database (Alumni Edition)</collection><collection>Technology Research Database</collection><collection>ProQuest SciTech Collection</collection><collection>ProQuest Technology Collection</collection><collection>ProQuest Central (Alumni) (purchase pre-March 2016)</collection><collection>ProQuest Central (Alumni Edition)</collection><collection>ProQuest Central UK/Ireland</collection><collection>Advanced Technologies &amp; Aerospace Collection</collection><collection>ProQuest Central Essentials</collection><collection>ProQuest Central</collection><collection>Technology Collection</collection><collection>ProQuest One Community College</collection><collection>ProQuest Central Korea</collection><collection>ProQuest Central Student</collection><collection>SciTech Premium Collection</collection><collection>ProQuest Computer Science Collection</collection><collection>Computer Science Database</collection><collection>Advanced Technologies Database with Aerospace</collection><collection>Computer and Information Systems Abstracts – Academic</collection><collection>Computer and Information Systems Abstracts Professional</collection><collection>Computing Database</collection><collection>Advanced Technologies &amp; Aerospace Database</collection><collection>ProQuest Advanced Technologies &amp; Aerospace Collection</collection><collection>ProQuest One Academic Eastern Edition (DO NOT USE)</collection><collection>ProQuest One Academic</collection><collection>ProQuest One Academic UKI Edition</collection><collection>ProQuest Central Basic</collection><jtitle>Journal of functional programming</jtitle></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>MU, SHIN-CHENG</au><au>CHIANG, TSUNG-JU</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>Longest segment of balanced parentheses: an exercise in program inversion in a segment problem</atitle><jtitle>Journal of functional programming</jtitle><addtitle>J. Funct. Prog</addtitle><date>2021-01-01</date><risdate>2021</risdate><volume>31</volume><artnum>e31</artnum><issn>0956-7968</issn><eissn>1469-7653</eissn><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.</abstract><cop>Cambridge, UK</cop><pub>Cambridge University Press</pub><doi>10.1017/S0956796821000253</doi><tpages>10</tpages><orcidid>https://orcid.org/0000-0002-4755-601X</orcidid></addata></record>
fulltext fulltext
identifier ISSN: 0956-7968
ispartof Journal of functional programming, 2021-01, Vol.31, Article e31
issn 0956-7968
1469-7653
language eng
recordid cdi_proquest_journals_2601780320
source EZB-FREE-00999 freely available EZB journals
subjects Functional Pearl
Segments
title Longest segment of balanced parentheses: an exercise in program inversion in a segment problem
url https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-02-06T23%3A09%3A11IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-proquest_cross&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=Longest%20segment%20of%20balanced%20parentheses:%20an%20exercise%20in%20program%20inversion%20in%20a%20segment%20problem&rft.jtitle=Journal%20of%20functional%20programming&rft.au=MU,%20SHIN-CHENG&rft.date=2021-01-01&rft.volume=31&rft.artnum=e31&rft.issn=0956-7968&rft.eissn=1469-7653&rft_id=info:doi/10.1017/S0956796821000253&rft_dat=%3Cproquest_cross%3E2601780320%3C/proquest_cross%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_pqid=2601780320&rft_id=info:pmid/&rft_cupid=10_1017_S0956796821000253&rfr_iscdi=true