Attributed Variables for Dynamic Constraint Solving
نویسنده
چکیده
Armin Wolf Fraunhofer Gesells haft Institute for Computer Ar hite ture and Software Te hnology (FIRST) Kekul estra e 7, D-12489 Berlin, Germany Armin.Wolf first.fraunhofer.de http://www.first.fraunhofer.de Abstra t Attributed variables are an approved te hnique for onstraint storage and retrieval. They provide a means of asso iating arbitrary attributes that an be used to extend the uni ation in logi programming language implementations and were primarily designed as a lean interfa e between Prolog and onstraint solvers. However, this widely used state-of-the-art method is inappropriate if variable bindings and unbindings o ur in an arbitrary order, espe ially during dynami onstraint pro essing. In this paper, a new extended s hema of attributed variables is presented that eÆ iently supports arbitrary variable bindings and unbindings. In addition, its use and adequa y for dynami onstraint pro essing is disussed. 1 Introdu tion DJCHR { dynami onstraint handling in Java [3℄ { is a re ent implementation of Constraint Handling Rules (CHR) in Java that supports dynami onstraint pro essing and thus opens up new appli ation areas of CHR, like dynami ba ktra king or loal sear h. Dynami onstraint handling with CHR means that a dynami ally hanging set of symboli onstraints (i.e. predi ates) is transformed by rule appli ation, eventually resulting in a simpli ed representation. For instan e, the rules less(A,B), less(B,C) ==> less(A,C) and less(A,A) <=> false are not able to transform the onstraints less(a,X), less(Y,a). However, if the synta ti al equation X=Y is added and X is bound to Y, then the onstraints are transformed to less(a,Y), less(Y,a), X=Y, less(a,a) and further to less(a,Y), less(Y,a), X=Y, false. If one of the given onstraints is deleted, both rule appli ations have to be undone. For eÆ ient rule appli ations, ea h onstraint is implemented as both ode and data, i.e. an entry in the onstraint store. Whenever a CHR onstraint is added (exe uted) or re-a tivated (re-exe uted), the appli ability of the CHR that ontains the exe uted onstraint in its heads is he ked. Su h a onstraint is alled a tive; all other onstraints in the onstraint store are alled passive. Among other things, it must be he ked whether the a tive onstraint mat hes one of the rule's heads and whether there are passive partner onstraints that mat h the other heads. Like others [2℄, we believe that the real hallenge in implementing multi-headed CHR is eÆ iently omputing potential partner onstraints. A naive solution is to onsider all other onstraints. However, if there are shared variables in the heads, only a subset has to be onsidered. For instan e, the transitivity rule less(A,B), less(B,C) ==> less(A,C), whi h has to be tried against all a tive onstraints less(u, v) only those \less" onstraints have to be onsidered as potential partners that have either v in their rst argument position or u in their se ond. In order to (partially) apply this knowledge, the idea of variable indexing ( .f. [2℄) is used. Here, the partner sear h is better fo used if the arguments of the a tive onstraints are variables, e.g. if u and v are variables. The onstraints in the store are therefore distributed over all variables that o ur in these onstraints. The onstraints are atta hed to their variables as attribute values ( .f. [1℄). The attributes are named after the onstraints. For efient O(1) a ess, onstraint symbols are mapped to array indi es. The onstraints with the same symbols are stored under the same index. X: attr val
منابع مشابه
ذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2001