Zipping strategies and attribute grammars

Detalhes bibliográficos
Autor(a) principal: Macedo, José Nuno
Data de Publicação: 2022
Outros Autores: Viera, Marcos, Saraiva, João
Idioma: eng
Título da fonte: Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
Texto Completo: https://hdl.handle.net/1822/90289
Resumo: 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ório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository_id_str 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ório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãoinstacron:RCAAP2024-05-11T07:11:08Zoai:repositorium.sdum.uminho.pt:1822/90289Portal AgregadorONGhttps://www.rcaap.pt/oai/openairemluisa.alvim@gmail.comopendoar:71602024-05-11T07:11:08Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãofalse
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ório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron:RCAAP
instname_str Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron_str RCAAP
institution RCAAP
reponame_str Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
collection Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository.name.fl_str_mv Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
repository.mail.fl_str_mv mluisa.alvim@gmail.com
_version_ 1817545231654977536