Export Ready — 

Efficient embedding of strategic attribute grammars via memoization

Bibliographic Details
Main Author: Macedo, José Nuno Castro
Publication Date: 2023
Other Authors: Rodrigues, Emanuel, Viera, Marcos, Saraiva, João
Language: eng
Source: Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
Download full: https://hdl.handle.net/1822/89924
Summary: Strategic term re-writing and attribute grammars are two powerful programming techniques widely used in language engineering. The former relies on strategies to apply term rewrite rules in defining large-scale language transformations, while the latter is suitable to express context-dependent language processing algorithms. These two techniques can be expressed and combined via a powerful navigation abstraction: generic zippers. This results in a concise zipper-based embedding offering the expressiveness of both techniques. Such elegant embedding has a severe limitation since it recomputes attribute values. This paper presents a proper and efficient embedding of both techniques. First, attribute values are memoized in the zipper data structure, thus avoiding their re-computation. Moreover, strategic zipper based functions are adapted to access such memoized values. We have implemented our memoized embedding as the Ztrategic library and we benchmarked it against the state-of-the-art Strafunski and Kiama libraries. Our first results show that we are competitive against those two well established libraries.
id RCAP_dce703bd4d7ec73967f3445de8cda1ed
oai_identifier_str oai:repositorium.sdum.uminho.pt:1822/89924
network_acronym_str RCAP
network_name_str Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
repository_id_str https://opendoar.ac.uk/repository/7160
spelling Efficient embedding of strategic attribute grammars via memoizationStrategic programmingAttribute grammarsZippersGeneric traversalsStrategic term re-writing and attribute grammars are two powerful programming techniques widely used in language engineering. The former relies on strategies to apply term rewrite rules in defining large-scale language transformations, while the latter is suitable to express context-dependent language processing algorithms. These two techniques can be expressed and combined via a powerful navigation abstraction: generic zippers. This results in a concise zipper-based embedding offering the expressiveness of both techniques. Such elegant embedding has a severe limitation since it recomputes attribute values. This paper presents a proper and efficient embedding of both techniques. First, attribute values are memoized in the zipper data structure, thus avoiding their re-computation. Moreover, strategic zipper based functions are adapted to access such memoized values. We have implemented our memoized embedding as the Ztrategic library and we benchmarked it against the state-of-the-art Strafunski and Kiama libraries. Our first results show that we are competitive against those two well established libraries.This work is financed by National Funds through the Portuguese funding agency, FCT - Fundação para a Ciência e a Tecnologia, within project LA/P/0063/2020. The first author is also sponsored by FCT grant 2021.08184.BD.Association for Computing Machinery (ACM)Universidade do MinhoMacedo, José Nuno CastroRodrigues, EmanuelViera, MarcosSaraiva, João20232023-01-01T00:00:00Zconference paperinfo:eu-repo/semantics/publishedVersionapplication/pdfhttps://hdl.handle.net/1822/89924engJosé Nuno Macedo, Emanuel Rodrigues, Marcos Viera, and João Saraiva. 2023. Efficient Embedding of Strategic Attribute Grammars via Memoization. In Proceedings of the 2023 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation (PEPM ’23), January 16–17, 2023, Boston, MA, USA. ACM, New York, NY, USA, 14 pages. https://doi.org/10.1145/3571786.3573019979-8-4007-0011-810.1145/3571786.3573019https://dl.acm.org/doi/10.1145/3571786.3573019info:eu-repo/semantics/openAccessreponame:Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)instname:FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologiainstacron:RCAAP2024-05-11T06:30:21Zoai:repositorium.sdum.uminho.pt:1822/89924Portal AgregadorONGhttps://www.rcaap.pt/oai/openaireinfo@rcaap.ptopendoar:https://opendoar.ac.uk/repository/71602025-05-28T15:55:19.644345Repositórios Científicos de Acesso Aberto de Portugal (RCAAP) - FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologiafalse
dc.title.none.fl_str_mv Efficient embedding of strategic attribute grammars via memoization
title Efficient embedding of strategic attribute grammars via memoization
spellingShingle Efficient embedding of strategic attribute grammars via memoization
Macedo, José Nuno Castro
Strategic programming
Attribute grammars
Zippers
Generic traversals
title_short Efficient embedding of strategic attribute grammars via memoization
title_full Efficient embedding of strategic attribute grammars via memoization
title_fullStr Efficient embedding of strategic attribute grammars via memoization
title_full_unstemmed Efficient embedding of strategic attribute grammars via memoization
title_sort Efficient embedding of strategic attribute grammars via memoization
author Macedo, José Nuno Castro
author_facet Macedo, José Nuno Castro
Rodrigues, Emanuel
Viera, Marcos
Saraiva, João
author_role author
author2 Rodrigues, Emanuel
Viera, Marcos
Saraiva, João
author2_role author
author
author
dc.contributor.none.fl_str_mv Universidade do Minho
dc.contributor.author.fl_str_mv Macedo, José Nuno Castro
Rodrigues, Emanuel
Viera, Marcos
Saraiva, João
dc.subject.por.fl_str_mv Strategic programming
Attribute grammars
Zippers
Generic traversals
topic Strategic programming
Attribute grammars
Zippers
Generic traversals
description Strategic term re-writing and attribute grammars are two powerful programming techniques widely used in language engineering. The former relies on strategies to apply term rewrite rules in defining large-scale language transformations, while the latter is suitable to express context-dependent language processing algorithms. These two techniques can be expressed and combined via a powerful navigation abstraction: generic zippers. This results in a concise zipper-based embedding offering the expressiveness of both techniques. Such elegant embedding has a severe limitation since it recomputes attribute values. This paper presents a proper and efficient embedding of both techniques. First, attribute values are memoized in the zipper data structure, thus avoiding their re-computation. Moreover, strategic zipper based functions are adapted to access such memoized values. We have implemented our memoized embedding as the Ztrategic library and we benchmarked it against the state-of-the-art Strafunski and Kiama libraries. Our first results show that we are competitive against those two well established libraries.
publishDate 2023
dc.date.none.fl_str_mv 2023
2023-01-01T00:00:00Z
dc.type.driver.fl_str_mv conference paper
dc.type.status.fl_str_mv info:eu-repo/semantics/publishedVersion
status_str publishedVersion
dc.identifier.uri.fl_str_mv https://hdl.handle.net/1822/89924
url https://hdl.handle.net/1822/89924
dc.language.iso.fl_str_mv eng
language eng
dc.relation.none.fl_str_mv José Nuno Macedo, Emanuel Rodrigues, Marcos Viera, and João Saraiva. 2023. Efficient Embedding of Strategic Attribute Grammars via Memoization. In Proceedings of the 2023 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation (PEPM ’23), January 16–17, 2023, Boston, MA, USA. ACM, New York, NY, USA, 14 pages. https://doi.org/10.1145/3571786.3573019
979-8-4007-0011-8
10.1145/3571786.3573019
https://dl.acm.org/doi/10.1145/3571786.3573019
dc.rights.driver.fl_str_mv info:eu-repo/semantics/openAccess
eu_rights_str_mv openAccess
dc.format.none.fl_str_mv application/pdf
dc.publisher.none.fl_str_mv Association for Computing Machinery (ACM)
publisher.none.fl_str_mv Association for Computing Machinery (ACM)
dc.source.none.fl_str_mv reponame:Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
instname:FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologia
instacron:RCAAP
instname_str FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologia
instacron_str RCAAP
institution RCAAP
reponame_str Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
collection Repositórios Científicos de Acesso Aberto de Portugal (RCAAP)
repository.name.fl_str_mv Repositórios Científicos de Acesso Aberto de Portugal (RCAAP) - FCCN, serviços digitais da FCT – Fundação para a Ciência e a Tecnologia
repository.mail.fl_str_mv info@rcaap.pt
_version_ 1833595625114959872