Zipping strategies and attribute grammars

Bibliographic Details
Main Author: Macedo, José Nuno
Publication Date: 2022
Other Authors: 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/90289
Summary: Strategic term rewriting and attribute grammars are two powerful programming techniques widely used in language engineering. The former relies on strategies (recursion schemes) to apply term rewrite rules in defining transformations, while the latter is suitable for expressing context-dependent language processing algorithms. Each of these techniques, however, is usually implemented by its own powerful and large processor system. As a result, it makes such systems harder to extend and to combine. We present the embedding of both strategic tree rewriting and attribute grammars in a zipper-based, purely functional setting. The embedding of the two techniques in the same setting has several advantages: First, we easily combine/zip attribute grammars and strategies, thus providing language engineers the best of the two worlds. Second, the combined embedding is easier to maintain and extend since it is written in a concise and uniform setting. We show the expressive power of our library in optimizing Haskell let expressions, expressing several Haskell refactorings and solving several language processing tasks for an Oberon-0 compiler.
id RCAP_c5bc8ab0a368e008381aadaebbdec43d
oai_identifier_str oai:repositorium.sdum.uminho.pt:1822/90289
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 Zipping strategies and attribute grammarsAttribute grammarsStrategic term rewritingZippersEngenharia e Tecnologia::Engenharia Eletrotécnica, Eletrónica e InformáticaStrategic term rewriting and attribute grammars are two powerful programming techniques widely used in language engineering. The former relies on strategies (recursion schemes) to apply term rewrite rules in defining transformations, while the latter is suitable for expressing context-dependent language processing algorithms. Each of these techniques, however, is usually implemented by its own powerful and large processor system. As a result, it makes such systems harder to extend and to combine. We present the embedding of both strategic tree rewriting and attribute grammars in a zipper-based, purely functional setting. The embedding of the two techniques in the same setting has several advantages: First, we easily combine/zip attribute grammars and strategies, thus providing language engineers the best of the two worlds. Second, the combined embedding is easier to maintain and extend since it is written in a concise and uniform setting. We show the expressive power of our library in optimizing Haskell let expressions, expressing several Haskell refactorings and solving several language processing tasks for an Oberon-0 compiler.This work is financed by National Funds through the Portuguese funding agency, FCT - Fundação para a Ciˆencia e a Tecnologia, within project LA/P/0063/2020. The first author is also sponsored by FCT grant 2021.08184.BDSpringer, ChamUniversidade do MinhoMacedo, José NunoViera, MarcosSaraiva, João20222022-01-01T00:00:00Zconference paperinfo:eu-repo/semantics/publishedVersionapplication/pdfhttps://hdl.handle.net/1822/90289engMacedo, J.N., Viera, M., Saraiva, J. (2022). Zipping Strategies and Attribute Grammars. In: Hanus, M., Igarashi, A. (eds) Functional and Logic Programming. FLOPS 2022. Lecture Notes in Computer Science, vol 13215. Springer, Cham. https://doi.org/10.1007/978-3-030-99461-7_7978-3-030-99460-00302-974310.1007/978-3-030-99461-7_7978-3-030-99461-7https://link.springer.com/chapter/10.1007/978-3-030-99461-7_7info: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-11T07:11:08Zoai:repositorium.sdum.uminho.pt:1822/90289Portal AgregadorONGhttps://www.rcaap.pt/oai/openaireinfo@rcaap.ptopendoar:https://opendoar.ac.uk/repository/71602025-05-28T16:18:20.323862Repositó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 Zipping strategies and attribute grammars
title Zipping strategies and attribute grammars
spellingShingle Zipping strategies and attribute grammars
Macedo, José Nuno
Attribute grammars
Strategic term rewriting
Zippers
Engenharia e Tecnologia::Engenharia Eletrotécnica, Eletrónica e Informática
title_short Zipping strategies and attribute grammars
title_full Zipping strategies and attribute grammars
title_fullStr Zipping strategies and attribute grammars
title_full_unstemmed Zipping strategies and attribute grammars
title_sort Zipping strategies and attribute grammars
author Macedo, José Nuno
author_facet Macedo, José Nuno
Viera, Marcos
Saraiva, João
author_role author
author2 Viera, Marcos
Saraiva, João
author2_role author
author
dc.contributor.none.fl_str_mv Universidade do Minho
dc.contributor.author.fl_str_mv Macedo, José Nuno
Viera, Marcos
Saraiva, João
dc.subject.por.fl_str_mv Attribute grammars
Strategic term rewriting
Zippers
Engenharia e Tecnologia::Engenharia Eletrotécnica, Eletrónica e Informática
topic Attribute grammars
Strategic term rewriting
Zippers
Engenharia e Tecnologia::Engenharia Eletrotécnica, Eletrónica e Informática
description Strategic term rewriting and attribute grammars are two powerful programming techniques widely used in language engineering. The former relies on strategies (recursion schemes) to apply term rewrite rules in defining transformations, while the latter is suitable for expressing context-dependent language processing algorithms. Each of these techniques, however, is usually implemented by its own powerful and large processor system. As a result, it makes such systems harder to extend and to combine. We present the embedding of both strategic tree rewriting and attribute grammars in a zipper-based, purely functional setting. The embedding of the two techniques in the same setting has several advantages: First, we easily combine/zip attribute grammars and strategies, thus providing language engineers the best of the two worlds. Second, the combined embedding is easier to maintain and extend since it is written in a concise and uniform setting. We show the expressive power of our library in optimizing Haskell let expressions, expressing several Haskell refactorings and solving several language processing tasks for an Oberon-0 compiler.
publishDate 2022
dc.date.none.fl_str_mv 2022
2022-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/90289
url https://hdl.handle.net/1822/90289
dc.language.iso.fl_str_mv eng
language eng
dc.relation.none.fl_str_mv Macedo, J.N., Viera, M., Saraiva, J. (2022). Zipping Strategies and Attribute Grammars. In: Hanus, M., Igarashi, A. (eds) Functional and Logic Programming. FLOPS 2022. Lecture Notes in Computer Science, vol 13215. Springer, Cham. https://doi.org/10.1007/978-3-030-99461-7_7
978-3-030-99460-0
0302-9743
10.1007/978-3-030-99461-7_7
978-3-030-99461-7
https://link.springer.com/chapter/10.1007/978-3-030-99461-7_7
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 Springer, Cham
publisher.none.fl_str_mv Springer, Cham
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_ 1833595864031952896