×

Meta-programming in \(CLP({\mathcal R})\). (English) Zbl 0886.68032

Summary: A widely used property of Prolog is that it is possible to write Prolog programs to construct and manipulate other Prolog programs in a very general manner. Unfortunately, this property is not carried over to richer languages such as \(\text{CLP}({\mathcal R})\) – the manipulation of \(\text{CLP}({\mathcal R})\) programs in \(\text{CLP}({\mathcal R})\) is quite limited. The reason is that the equality of terms in \(\text{CLP}({\mathcal R})\) is not based on their syntactic structure. We propose an extended language, \(\text{CLP}({\mathcal R}+{\mathcal M})\), in which programs may be represented and structurally manipulated. Importantly, \(\text{CLP}({\mathcal R}+{\mathcal M})\) is not just a meta-language for \(\text{CLP}({\mathcal R})\), but it can also be used as its own meta-language. We present a decision algorithm for \({\mathcal R}+{\mathcal M}\) constraints, discuss implementation issues, and describe the implementation of a subclass of \({\mathcal R}+{\mathcal M}\) constraints. Finally, by building on the extended language, we present an integrated set of system predicates and a methodology for practical meta-programming.

MSC:

68N17 Logic programming

Keywords:

Prolog
PDFBibTeX XMLCite
Full Text: DOI