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
About

About

I'm an assistant professor at the Department of Informatics Engineering (DEI) of the Faculty of Engineering of the University of Porto (FEUP), Portugal, and a senior researcher at HASLab, INESC TEC's unit focused on high-assurance software development, developing, teaching and applying formal techniques for software engineering.


My main research interest lies in trustworthy software design, particularly in the application of lightweight formal methods based on model checking and model finding to software engineering. I'm one of the developers of Alloy 6 and its Analyzer, a tool to analyze software models. I've also been tailoring such techniques for the robotics domain to promote the development of dependable robotics software, and I've applied them in knowledge transfer and consultancy projects.


My teaching activities mainly focus on programming languages and formal methods for software engineering. In this context, I also maintain Alloy4Fun, a platform for teaching Alloy.

Interest
Topics
Details

Details

  • Name

    Nuno Moreira Macedo
  • Role

    Senior Researcher
  • Since

    01st November 2011
004
Publications

2026

On Quantitative Solution Iteration in QAlloy

Authors
Silva, P; Macedo, N; Oliveira, JN;

Publication
Lecture Notes in Computer Science

Abstract
A key feature of model finding techniques allows users to enumerate and explore alternative solutions. However, it is challenging to guarantee that the generated instances are relevant to the user, representing effectively different scenarios. This challenge is exacerbated in quantitative modelling, where one must consider both the qualitative, structural part of a model, and the quantitative data on top of it. This results in a search space of possibly infinite candidate solutions, often infinitesimally similar to one another. Thus, research on instance enumeration in qualitative model finding is not directly applicable to the quantitative context, which requires more sophisticated methods to navigate the solution space effectively. The main goal of this paper is to explore a generic approach for navigating quantitative solution spaces and showcase different iteration operations, aiming to generate instances that differ considerably from those previously seen and promote a larger coverage of the search space. Such operations are implemented in QAlloy – a quantitative extension to Alloy – on top of Max-SMT solvers, and are evaluated against several examples ranging, in particular, over the integer and fuzzy domains. © 2025 Elsevier B.V., All rights reserved.

2025

Alloy Repair Hint Generation Based on Historical Data

Authors
Barros, A; Neto, H; Cunha, A; Macedo, N; Paiva, ACR;

Publication
FORMAL METHODS, PT II, FM 2024

Abstract
Platforms to support novices learning to program are often accompanied by automated next-step hints that guide them towards correct solutions. Many of those approaches are data-driven, building on historical data to generate higher quality hints. Formal specifications are increasingly relevant in software engineering activities, but very little support exists to help novices while learning. Alloy is a formal specification language often used in courses on formal software development methods, and a platform-Alloy4Fun-has been proposed to support autonomous learning. While non-data-driven specification repair techniques have been proposed for Alloy that could be leveraged to generate next-step hints, no data-driven hint generation approach has been proposed so far. This paper presents the first data-driven hint generation technique for Alloy and its implementation as an extension to Alloy4Fun, being based on the data collected by that platform. This historical data is processed into graphs that capture past students' progress while solving specification challenges. Hint generation can be customized with policies that take into consideration diverse factors, such as the popularity of paths in those graphs successfully traversed by previous students. Our evaluation shows that the performance of this new technique is competitive with non-data-driven repair techniques. To assess the quality of the hints, and help select the most appropriate hint generation policy, we conducted a survey with experienced Alloy instructors.

2024

Assessing the impact of hints in learning formal specification

Authors
Cunha, A; Macedo, N; Campos, JC; Margolis, I; Sousa, E;

Publication
2024 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: SOFTWARE ENGINEERING EDUCATION AND TRAINING, ICSE-SEET 2024

Abstract
Background: Many progranunmg environments include automated feedback in the form of hints to help novices learn autonomously. Some experimental studies investigated the impact of automated liints in the immediate, performance and learning retention in that context. Automated feedback is also becoming a popular research topic in the context of formal specification languages, but so far no experimental studies have been conducted to assess its impact while learning such languages. Objective: We aim to investigate the impact of different types of automated hints while learning a formal specification language, not only in terms of immediate performance and learning retention, but also in the emotional response of the students. Method: We conducted a simple one-factor randomised experiment in 2 sessions involving 85 BSc students majoring in CSE. In the 1st session students were divided in 1 control group and 3 experimental groups, each receiving a different type of hint while learning to specify simple, requirements with the Alloy formal specification language. To assess the impact of hints on learning retention, in the 2nd session, 1 week later, students had no hints while formalising requirements. Before and after each session the students answered a standard self-reporting emotional survey to assess their emotional response to the experiment. Results: Of the 3 types of hints considered, only those pointing to the precise location of an error had a positive impact on the immediate performance and none had significant impact in learning retention. Hint availability also causes a significant impact on the emotional response, but no significant emotional :impact exists once hints are no longer available (i.e. no deprivation effects were detected). Conclusion: Although none of the evaluated hints had an impact on learning retention, learning a formal specification language with an environment that provides hints with precise error locations seems to contribute to a better overall experience without apparent drawbacks. Further studies are needed to investigate if other kind of feedback, namely hints combined with some sort of self explanation prompts, can have a positive impact in learning retention.

2024

Validating multiple variants of an automotive light system with Alloy 6

Authors
Cunha, A; Macedo, N; Liu, C;

Publication
INTERNATIONAL JOURNAL ON SOFTWARE TOOLS FOR TECHNOLOGY TRANSFER

Abstract
This paper reports on the development and validation of a formal model for an automotive adaptive exterior lights system (ELS) with multiple variants in Alloy 6, which is the most recent version of the Alloy lightweight formal specification language that supports mutable relations and temporal logic. We explore different strategies to address variability, one in pure Alloy and another through an annotative language extension. We then show how Alloy and its Analyzer can be used to validate systems of this nature, namely by checking that the reference scenarios are admissible, and to automatically verify whether the established requirements hold. A prototype was developed to translate the provided validation sequences into Alloy and back to further automate the validation process. The resulting ELS model was validated against the provided validation sequences and verified for most of requirements for all variants.

2024

Alloy Goes Fuzzy

Authors
Silva, P; Cunha, A; Macedo, N; Oliveira, JN;

Publication
RIGOROUS STATE-BASED METHODS, ABZ 2024

Abstract
Humans are good at understanding subjective or vague statements which, however, are hard to express in classical logic. Fuzzy logic is an evolution of classical logic that can cope with vague terms by handling degrees of truth and not just the crisp values true and false. Logic is the formal basis of computing, enabling the formal design of systems supported by tools such as model checkers and theorem provers.This paper shows how a model checker such as Alloy can evolve to handle both classical and fuzzy logic, enabling the specification of high-level quantitative relational models in the fuzzy domain. In particular, the paper showcases how QAlloy-F (a conservative, general-purpose quantitative extension to standard Alloy) can be used to tackle fuzzy problems, namely in the context of validating the design of fuzzy controllers. The evaluation of QAlloy-F against examples taken from various classes of fuzzy case studies shows the approach to be feasible.

Supervised
thesis

2023

Data-Driven Hint Generation for Alloy using Historial Student Submissions

Author
Ana Inês Oliveira de Barros

Institution
INESCTEC

2023

Security Testing of Web APIs

Author
Gonçalo André Carneiro Teixeira

Institution
INESCTEC

2023

Automatic Specification Repair in Contract Programming

Author
Alexandre Almeida de Abreu Filho

Institution
INESCTEC

2022

Automatic Repair of Behavioural Specifications

Author
Jorge Gabriel Alves Cerqueira

Institution
INESCTEC

2022

Verificação e descoberta de modelos probabilísticos no Alloy Analyser.

Author
Pedro Faria Durães da Silva

Institution
INESCTEC