Hostname: page-component-78c5997874-g7gxr Total loading time: 0 Render date: 2024-11-05T16:02:12.892Z Has data issue: false hasContentIssue false

A backward analysis for constraint logic programs

Published online by Cambridge University Press:  26 July 2002

ANDY KING
Affiliation:
University of Kent at Canterbury, Canterbury CT2 7NF, UK (e-mail: [email protected])
LUNJIN LU
Affiliation:
Oakland University, Rochester, MI 48309, USA (e-mail: [email protected])

Abstract

One recurring problem in program development is that of understanding how to re-use code developed by a third party. In the context of (constraint) logic programming, part of this problem reduces to figuring out how to query a program. If the logic program does not come with any documentation, then the programmer is forced to either experiment with queries in an ad hoc fashion or trace the control-flow of the program (backward) to infer the modes in which a predicate must be called so as to avoid an instantiation error. This paper presents an abstract interpretation scheme that automates the latter technique. The analysis presented in this paper can infer moding properties which if satisfied by the initial query, come with the guarantee that the program and query can never generate any moding or instantiation errors. Other applications of the analysis are discussed. The paper explains how abstract domains with certain computational properties (they condense) can be used to trace control-flow backward (right-to-left) to infer useful properties of initial queries. A correctness argument is presented and an implementation is reported.

Type
Research Article
Copyright
© 2002 Cambridge University Press

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)