About
Student at the MAP-i doctoral program. My main research interests are functional programming, language parsing, model testing and program calculation.

Student at the MAP-i doctoral program. My main research interests are functional programming, language parsing, model testing and program calculation.
Student at the MAP-i doctoral program. My main research interests are functional programming, language parsing, model testing and program calculation.
2025
Authors
Macedo, JN; Viera, M; Saraiva, J;
Publication
PROCEEDINGS OF SLE 2025 18TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON SOFTWARE LANGUAGE ENGINEERING, SLE 2025
Abstract
Software testing is an integral part of modern software development. Testing frameworks are part of the toolset of any software language allowing programmers to test their programs in order to detect bugs. Unfortunately, there is no work on testing in attribute grammars. In this paper we combine the powerful property-based testing technique with the attribute grammar formalism. In such property-based attribute grammars, properties are defined on attribute instances. Properties are tested on large sets of randomly generated (abstract syntax) trees by evaluating their attributes. We present an implementation that relies on strategies to express property-based attribute grammars. Strategies are tree-based recursion patterns that are used to encode logic quantifiers defining the properties.
2024
Authors
Macedo, JN; Rodrigues, E; Viera, M; Saraiva, J;
Publication
JOURNAL OF SYSTEMS AND SOFTWARE
Abstract
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 re-write rules in defining largescale 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. In addition, we increase the functionalities of strategic programming, enabling the definition of outwards traversals; i.e. outside the starting position. 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 hosted our memoized zipper-based embedding of strategic attribute grammars both in the Haskell and Python programming languages. Moreover, we benchmarked the libraries supporting both embedding against the state-of-the-art Haskell-based Strafunski and Scala-based Kiama libraries. The first results show that our Haskell Ztrategic library is very competitive against those two well established libraries.
2024
Authors
Rodrigues, E; Macedo, JN; Viera, M; Saraiva, J;
Publication
Proceedings of the 19th International Conference on Evaluation of Novel Approaches to Software Engineering, ENASE 2024, Angers, France, April 28-29, 2024.
Abstract
This paper presents pyZtrategic: a library that embeds strategic term rewriting and attribute grammars in the Python programming language. Strategic term rewriting 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. Thus, pyZtrategic offers Python programmers recursion schemes (strategies) which apply term rewrite rules in defining large scale language transformations. It also offers attribute grammars to express context-dependent language processing algorithms. PyZtrategic offers the best of those two worlds, thus providing powerful abstractions to express software maintenance and evolution tasks. Moreover, we developed several language engineering problems in pyZtrategic, and we compare it to well established strategic programming and attribute grammar systems. Our preliminary results show that our library offers similar expressiveness as such systems, but, unfortunately, it does suffer from the current poor runtime performance of the Python language. © 2024 by SCITEPRESS – Science and Technology Publications, Lda.
2023
Authors
Macedo, JN; Rodrigues, E; Viera, M; Saraiva, J;
Publication
Proceedings of the 2023 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation, PEPM 2023, Boston, MA, USA, January 16-17, 2023
Abstract
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 re-write 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. © 2023 ACM.
2023
Authors
Ribeiro, F; Macedo, JN; Tsushima, K;
Publication
2023 IEEE/ACM INTERNATIONAL WORKSHOP ON AUTOMATED PROGRAM REPAIR, APR
Abstract
Type systems and type inference systems can be used to help text and code generation models like GPT-3 produce more accurate and appropriate results. These systems provide information about the types of variables, functions, and other elements in a program or codebase, which can be used to guide the generation of new code or text. For example, a code generation model that is aware of the types of variables and functions being used in a program can generate code that is more likely to be syntactically correct and semantically meaningful. We argue for the specialization of language models such as GPT-3 for automatic program repair tasks, incorporating type information in the model's learning process. A trained language model is expected to perform better by understanding the nuances of type systems and using them for program repair, instead of just relying on the general structure of programs.
The access to the final selection minute is only available to applicants.
Please check the confirmation e-mail of your application to obtain the access code.