Meta-programming in CLP(ℛ)

Nevin Heintze, Spiro Michaylov, Peter J. Stuckey, Roland H.C. Yap

Research output: Contribution to journalArticleResearchpeer-review

5 Citations (Scopus)


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 CLP(ℛ) - the manipulation of CLP(ℛ) programs in CLP(ℛ) is quite limited. The reason is that the equality of terms in CLP(ℛ) is not based on their syntactic structure. We propose an extended language, CLP(ℛ + script M sign;), in which programs may be represented and structurally manipulated. Importantly, CLP(ℛ + script M sign;) is not just a meta-language for CLP(ℛ), but it can also be used as its own meta-language. We present a decision algorithm for ℛ + script M sign; constraints, discuss implementation issues, and describe the implementation of a subclass of ℛ + script M sign; constraints. Finally, by building on the extended language, we present an integrated set of system predicates and a methodology for practical meta-programming.

Original languageEnglish
Pages (from-to)221-259
Number of pages39
JournalJournal of Logic Programming
Issue number3
Publication statusPublished - 1 Jan 1997
Externally publishedYes

Cite this