Elsevier

Information and Computation

Volume 193, Issue 2, 15 September 2004, Pages 84-116
Information and Computation

Finite-tree analysis for constraint logic-based languages

https://doi.org/10.1016/j.ic.2004.04.005Get rights and content
Under an Elsevier user license
open archive

Abstract

Logic languages based on the theory of rational, possibly infinite, trees have much appeal in that rational trees allow for faster unification (due to the safe omission of the occurs-check) and increased expressivity (cyclic terms can provide very efficient representations of grammars and other useful objects). Unfortunately, the use of infinite rational trees has problems. For instance, many of the built-in and library predicates are ill-defined for such trees and need to be supplemented by run-time checks whose cost may be significant. Moreover, some widely used program analysis and manipulation techniques are correct only for those parts of programs working over finite trees. It is thus important to obtain, automatically, a knowledge of the program variables (the finite variables) that, at the program points of interest, will always be bound to finite terms. For these reasons, we propose here a new data-flow analysis, based on abstract interpretation, that captures such information. We present a parametric domain where a simple component for recording finite variables is coupled, in the style of the open product construction of Cortesi et al., with a generic domain (the parameter of the construction) providing sharing information. The sharing domain is abstractly specified so as to guarantee the correctness of the combined domain and the generality of the approach. This finite-tree analysis domain is further enhanced by coupling it with a domain of Boolean functions, called finite-tree dependencies, that precisely captures how the finiteness of some variables influences the finiteness of other variables. We also summarize our experimental results showing how finite-tree analysis, enhanced with finite-tree dependencies, is a practical means of obtaining precise finiteness information.

Keywords

Static analysis
Abstract interpretation
Rational unification
Occurs-check

Cited by (0)

This work has been partly supported by MURST projects “Automatic Program Certification by Abstract Interpretation,” “Abstract Interpretation, Type Systems and Control-Flow Analysis,” and “Constraint Based Verification of Reactive Systems.” Some of this work was done during visits of the fourth author to Leeds, funded by EPSRC under Grant M05645.