Cookies Policy
The website need some cookies and similar means to function. If you permit us, we will use those means to collect data on your visits for aggregated statistics to improve our service. Find out More
Accept Reject
  • Menu
Publications

Publications by José Nuno Macedo

2020

Expressing Disambiguation Filters as Combinators

Authors
Macedo, JN; Saraiva, J;

Publication
PROCEEDINGS OF THE 35TH ANNUAL ACM SYMPOSIUM ON APPLIED COMPUTING (SAC'20)

Abstract
Contrarily to most conventional programming languages where certain symbols are used so as to create non-ambiguous grammars, most recent programming languages allow ambiguity. These ambiguities are solved using disambiguation rules, which dictate how the software that parses these languages should behave when faced with ambiguities. Such rules are highly efficient but come with some limitations - they cannot be further modified, their behaviour is hidden, and changing them implies re-building a parser. We propose a different approach for disambiguation. A set of disambiguation filters (expressed as combinators) are provided, and disambiguation can be achieved by composing combinators. New combinators can be created and, by having the disambiguation step separated from the parsing step, disambiguation rules can be changed without modifying the parser.

2022

Zipping Strategies and Attribute Grammars

Authors
Macedo, JN; Viera, M; Saraiva, J;

Publication
Functional and Logic Programming - 16th International Symposium, FLOPS 2022, Kyoto, Japan, May 10-12, 2022, Proceedings

Abstract
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. © 2022, Springer Nature Switzerland AG.

2023

Efficient Embedding of Strategic Attribute Grammars via Memoization

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

2023

Beyond Code Generation: The Need for Type-Aware Language Models

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.