CHR max two Head limitation

From: Aykut Firat <aykut_at_MIT.EDU>
Date: Sun 07 Jul 2002 11:43:35 PM GMT
Message-Id: <5.0.2.1.2.20020707192436.02847e20@hesiod>
Hello,

I was trying to write simple CHR expressions for a particular problem 
involving symbolic equation solving, but the CHR limitation for maximum two 
head elements is causing serious trouble. For example, in order to write 
one CHR expression for subtraction, I needed the following statement--where 
bound/1 is also a constraint and signifies whether the variable is bound to 
a symbolic value(not the same as ground/1)--


@ sub(X,Y,Z), bound(X), bound(Y) ==> bound(Z).

and instead I had to work around the limitation by introducing dummy 
predicates:

@ sub(X,Y,Z), bound(X) ==> dummysub(X,Y,Z,X,0,0).
@ sub(X,Y,Z), bound(Y) ==> dummysub(X,Y,Z,0,Y,0).
@ dummysub(X,Y,Z,X,0,0), dummysub(X,Y,Z,0,Y,0) ==>  bound(Z).

Is there an easier solution? Should I consider using an expert system shell 
as a constraint store instead?

Thanks for your answers,
Received on Mon Jul 08 00:54:33 2002

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:15 PM GMT GMT