Re: CHR max two Head limitation

From: Aykut Firat <aykut_at_MIT.EDU>
Date: Tue 09 Jul 2002 04:31:07 PM GMT
Message-Id: <>
Hi Kish,

Thank you for your detailed answer. Using ech would be helpful, but I am 
having this error:

instantiation fault in getval_body('CHRcdelete_count'(_13159), _13162, mystore)

after making the syntactic changes and using ech instead [in Eclipse 5.3].

Do you have any idea why I get this fault in ech but not in chr?


At 11:37 AM 7/9/2002, Kish Shen wrote:
> >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.
>This is a restriction on our implementations of CHR. I assume you are using
>lib(chr) rather than the newer lib(ech). Note that lib(ech) relaxes some
>of the restrictions that were in lib(chr). In particular, more than two
>head constraints is allowed for simpagation and simplification rules, but
>not for propagation rules. Unfortunately, your example uses propagation
>In your particular case, could you not rewrite your bound/1 constraint so
>that it takes a list, e.g.:
>sub(X,Y,Z), bound([X,Y]) ==> bound([Z]).
>Does having >2 heads for simpagation and simplification rules help you?
>I would guess that if you are doing symbolic equation solving, you would
>be rewriting an equalition into a simplier form in many cases, in which
>case you would use the simplification rule, which does allow >2 heads.
> >Is there an easier solution? Should I consider using an expert system shell
> >as a constraint store instead?
>The other alternatives to writing constraints in ECLiPSe are to use
>the propia library, which is `higher level' than CHRs, or you can go
>lower level and use ECLiPSe's attributed variable and suspension
>facilities to write your own constraints.
>Without knowing more about your problem, it is difficult to make a more
>concrete suggestion, except to say that using the low-level facilities
>would probably not be easy. Also, for pure symbol manipulation, you
>may not need to use constraints at all.
>If you really need a CHR where you can write propagation rules with
>more than two heads, you may want to consider the CHR that comes with
>SICStus Prolog 3.
>--Kish Shen
>   IC-Parc
>   Imperial College
>   London SW7 2AZ
>   U.K.
Received on Tue Jul 09 17:33:34 2002

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