Hostname: page-component-77f85d65b8-8v9h9 Total loading time: 0 Render date: 2026-03-29T12:21:31.880Z Has data issue: false hasContentIssue false

Abstract Environment Trimming

Published online by Cambridge University Press:  15 January 2025

DANIEL JURJO-RIVAS
Affiliation:
Universidad Politécnica de Madrid (UPM), IMDEA Software Institute, Madrid, Spain (e-mails: daniel.jurjo@alumnos.upm.es, daniel.jurjo@imdea.org, josefrancisco.morales@upm.es, josef.morales@imdea.org)
JOSE F. MORALES
Affiliation:
Universidad Politécnica de Madrid (UPM), IMDEA Software Institute, Madrid, Spain (e-mails: daniel.jurjo@alumnos.upm.es, daniel.jurjo@imdea.org, josefrancisco.morales@upm.es, josef.morales@imdea.org)
PEDRO LÓPEZ-GARCÍA
Affiliation:
Spanish Council for Scientific Research, IMDEA Software Institute, Madrid, Spain(e-mail: pedro.lopez@csic.es)
MANUEL V. HERMENEGILDO
Affiliation:
Universidad Politécnica de Madrid (UPM), IMDEA Software Institute, Madrid, Spain (e-mails: manuel.hermenegildo@upm.es, manuel.hermenegildo@imdea.org)
Rights & Permissions [Opens in a new window]

Abstract

Variable sharing is a fundamental property in the static analysis of logic programs, since it is instrumental for ensuring correctness and increasing precision while inferring many useful program properties. Such properties include modes, determinacy, non-failure, cost, etc. This has motivated significant work on developing abstract domains to improve the precision and performance of sharing analyses. Much of this work has centered around the family of set-sharing domains, because of the high precision they offer. However, this comes at a price: their scalability to a wide set of realistic programs remains challenging and this hinders their wider adoption. In this work, rather than defining new sharing abstract domains, we focus instead on developing techniques which can be incorporated in the analyzers to address aspects that are known to affect the efficiency of these domains, such as the number of variables, without affecting precision. These techniques are inspired in others used in the context of compiler optimizations, such as expression reassociation and variable trimming. We present several such techniques and provide an extensive experimental evaluation of over 1100 program modules taken from both production code and classical benchmarks. This includes the Spectector cache analyzer, the s(CASP) system, the libraries of the Ciao system, the LPdoc documenter, the PLAI analyzer itself, etc. The experimental results are quite encouraging: we have obtained significant speedups, and, more importantly, the number of modules that require a timeout was cut in half. As a result, many more programs can be analyzed precisely in reasonable times.

Information

Type
Original Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press
Figure 0

Algorithm 1 A schematic description of entryToExit

Figure 1

Fig 1. qplan/3 predicate and its environment trimming-based transformation.

Figure 2

Algorithm 2 Functions to detect live and dead variables.

Figure 3

Algorithm 3 Version of entryToExit dynamically modifying the abstraction domain.

Figure 4

Table 1. Analysis times and statistics for the source code of LPdoc. Times are in mS

Figure 5

Fig 2. Cactus plot aggregating all the benchmarks (1185 modules). Times are in mS.

Figure 6

Fig 3. Scatter plot comparing absolute analysis times (in mS).

Figure 7

Fig 4. Scatter plot showing classic analysis time (in mS) vs. speedup obtained (logscaled base 10).

Figure 8

Table 2. Complete statistics

Supplementary material: File

Jurjo-Rivas et al. supplementary material

Jurjo-Rivas et al. supplementary material
Download Jurjo-Rivas et al. supplementary material(File)
File 707.7 KB