A Query-Based Constraint Acquisition Approach for Enhanced Precision in Program Precondition Inference

Program annotations in the form of function pre/postconditions play a crucial role in various software engineering and program verification tasks. However, the frequent unavailability of these annotations necessitates manual retrofitting. This paper shows how constraint acquisition, a learning framework derived from constraint programming and version space learning, can be extended for automatically inferring program preconditions. Our approach performs this inference in a black-box manner through automatic query generation and input-output observations of program executions. We introduce PreCA, the first-ever precondition inference framework leveraging query-based constraint acquisition. Notably, we specialize PreCA to handle memory-related preconditions on binary code, which pose significant challenges in data and information management systems. In contrast to prior black-box techniques, PreCA provides well-defined guarantees. Specifically, it employs a sound and complete method to generate preconditions consistent with all the observed input-output relationships of the program. Furthermore, empirical evaluations on our benchmark demonstrate that PreCA outperforms the results of state-of-the-art approaches, delivering comparable or superior results in 5s, as opposed to the 1-hour runtime of existing approaches on identical machines. We also present two successful use cases from the standard libc and the mbedtls cryptographic library. PreCA notably infers for the former one a more precise precondition than specified in the documentation.

Authors

Institutions

Publication Details

Journal
Journal of Artificial Intelligence Research
Published
2025-02-16
DOI
https://doi.org/10.1613/jair.1.16206
Citations
1
Primary Topic
Radiation Effects in Electronics
Type
article
Field-Weighted Citation Impact
0.73

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Query-Based Constraint Acquisition Approach for Enhanced Precision in Program Precondition Inference

Grégoire Menguy, Arnaud Gotlieb, Sébastien Bardin, Nadjib Lazaar
1 citations
Journal of Artificial Intelligence Research
Radiation Effects in Electronics
0.73
article

A Query-Based Constraint Acquisition Approach for Enhanced Precision in Program Precondition Inference

Grégoire Menguy, Arnaud Gotlieb, Sébastien Bardin, Nadjib Lazaar
article en
1 citations

Abstract

Program annotations in the form of function pre/postconditions play a crucial role in various software engineering and program verification tasks. However, the frequent unavailability of these annotations necessitates manual retrofitting. This paper shows how constraint acquisition, a learning framework derived from constraint programming and version space learning, can be extended for automatically inferring program preconditions. Our approach performs this inference in a black-box manner through automatic query generation and input-output observations of program executions. We introduce PreCA, the first-ever precondition inference framework leveraging query-based constraint acquisition. Notably, we specialize PreCA to handle memory-related preconditions on binary code, which pose significant challenges in data and information management systems. In contrast to prior black-box techniques, PreCA provides well-defined guarantees. Specifically, it employs a sound and complete method to generate preconditions consistent with all the observed input-output relationships of the program. Furthermore, empirical evaluations on our benchmark demonstrate that PreCA outperforms the results of state-of-the-art approaches, delivering comparable or superior results in 5s, as opposed to the 1-hour runtime of existing approaches on identical machines. We also present two successful use cases from the standard libc and the mbedtls cryptographic library. PreCA notably infers for the former one a more precise precondition than specified in the documentation.

Journal of Artificial Intelligence ResearchVol. 82
Commissariat à l'Énergie Atomique et aux Énergies Alternatives (FR), Simula Research Laboratory (NO), Laboratoire d'Intégration des Systèmes et des Technologies (FR), Laboratoire d'Informatique, de Robotique et de Microélectronique de Montpellier (FR)
European Commission, Agence Nationale de la Recherche, HORIZON EUROPE Framework Programme
Openalex Percentile: Top 31%
Radiation Effects in Electronics
0.73
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.