Meta-programming in CLP(R)

Nevin Heintze, Spiro Michaylov, Peter J. Stuckey, Roland H.C. Yap
1997 The Journal of Logic Programming  
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(A')--the manipulation of CLP(~) programs in CLP(~') is quite limited. The reason is that the equality of terms in CLP(J~') is not based on their syntactic structure. We propose an extended language, CLP(~ +~t'), in which programs may be represented and
more » ... lly manipulated. Importantly, CLP(,9~ +de') is not just a meta-language for CLP(A'), but it can also be used as its own meta-language. We present a decision algorithm for ~ +~" constraints, discuss implementation issues, and describe the implementation of a subclass of ~' +11 constraints. Finally, by building on the extended language, we present an integrated set of system predicates and a methodology for practical meta-programming.
doi:10.1016/s0743-1066(96)00145-8 fatcat:m4xldmp4azaw3cut7jobxcbjvu