Abstract The attributed variable data type plays an important role in many extensions to the basic Logic Programming language. It provides a flexible mechanism to implement constraint solvers over different domains in a standard logic programming system. To combine the technique of constraint solving with tabling and build a tabled constraint logic programming system, special work has to be done to handle attributed variables when they are copied into and out of tables. In this paper, we describe the implementation of attributed variables in XSB — a tabled logic programming system. We first introduce the internal representation of attributed variables and the interface between the internal representation and the user defined high level unification handler. Then, as the primary focus of the paper, we describe how the tabling mechanism in XSB can be extended to efficiently handle attributed variables. To save attributed variables in tables, the structure of subgoal table and answer table is modified, and the tabling engine itself requires extension as well.
[1]
Serge Le Huitouze.
A New Data Structure for Implementing Extensions to Prolog
,
1990,
PLILP.
[2]
Thom W. Frühwirth,et al.
Compiling Constraint Handling Rules into Prolog with Attributed Variables
,
1999,
PPDP.
[3]
Christian Holzbaur,et al.
Metastructures versus Attributed Variables in the Context of Extensible Unification
,
1992,
PLILP.
[4]
Danny De Schreye.
Mutable Terms in a Tabled Logic Programming System
,
1999
.
[5]
I. V. Ramakrishnan,et al.
Efficient data structures for tabled resolution
,
1997
.