Hostname: page-component-89b8bd64d-9prln Total loading time: 0 Render date: 2026-05-06T12:16:07.883Z Has data issue: false hasContentIssue false

Hiord$^{{\kern2pt}\sharp}$: An Approach to the Specification and Verification of Higher-Order (C)LP Programs

Published online by Cambridge University Press:  09 September 2025

MARCO CICCALÈ
Affiliation:
Universidad Politécnica de Madrid (UPM), IMDEA Software Institute, Madrid, Spain (e-mails: m.ciccale@alumnos.upm.es, marco.ciccale@imdea.org, daniel.jurjo@alumnos.upm.es, daniel.jurjo@imdea.org, josefrancisco.morales@upm.es, josef.morales@imdea.org)
DANIEL JURJO-RIVAS
Affiliation:
Universidad Politécnica de Madrid (UPM), IMDEA Software Institute, Madrid, Spain (e-mails: m.ciccale@alumnos.upm.es, marco.ciccale@imdea.org, 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: m.ciccale@alumnos.upm.es, marco.ciccale@imdea.org, 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-mails: pedro.lopez@csic.es, pedro.lopez@imdea.org)
MANUEL V. HERMENEGILDO
Affiliation:
Universidad Politécnica de Madrid (UPM), IMDEA Software Institute, Madrid, Spain (e-mail: manuel.hermenegildo@upm.es, manuel.hermenegildo@imdea.org)
Rights & Permissions [Opens in a new window]

Abstract

Higher-order constructs enable more expressive and concise code by allowing procedures to be parameterized by other procedures. Assertions allow expressing partial program specifications, which can be verified either at compile time (statically) or run time (dynamically). In higher-order programs, assertions can also describe higher-order arguments. While in the context of (constraint) logic programming ((C)LP), run-time verification of higher-order assertions has received some attention, compile-time verification remains relatively unexplored. We propose a novel approach for statically verifying higher-order (C)LP programs with higher-order assertions. Although we use the Ciao assertion language for illustration, our approach is quite general, and we believe is applicable to similar contexts. Higher-order arguments are described using predicate properties – a special kind of property which exploits the (Ciao) assertion language. We refine the syntax and semantics of these properties and introduce an abstract criterion to determine conformance to a predicate property at compile time, based on a semantic order relation comparing the predicate property with the predicate assertions. We then show how to handle these properties using an abstract interpretation-based static analyzer for programs with first-order assertions by reducing predicate properties to first-order properties. Finally, we report on a prototype implementation and evaluate it through various examples within the Ciao system.

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

Fig. 1. Example case analysis on a predicate property and assertions.

Figure 1

Table 1. Abs. conf. on “calls” example with ${{}^{\circ {\kern-2pt}}\mathit{Pre}}=$(X)

Figure 2

Table 2. Abs. conf. on “success” example with ${{}^{\circ {\kern-2pt}}\mathit{Pre}}=$(X) and ${{}^{\circ {\kern-2pt}}\mathit{Post}}=$(Y)

Figure 3

Algorithm 1 [Hiord]: Verify a higher-order program with higher-order assertions

Supplementary material: File

Ciccalè et al. supplementary material

Ciccalè et al. supplementary material
Download Ciccalè et al. supplementary material(File)
File 196.1 KB