Re: [eclipse-users] write files from CHR-eclipse

From: J. Manuel Velasco <jvelasco_at_guest.uji.es>
Date: Tue, 7 Nov 2006 10:02:01 +0100
Hello William,

I am glad to guide you to the eclipse CHR tutorial, but I am a newbie so I 
don't think I will be able to help you a lot.

Somebody explain me  how CHRs work, the right syntax you'll find at the 
eclipse tutorial that you will find in the following URL:

http://www.eclipse-clp.org/

Go to the link Documentation, then Eclipse Tutorial Documentation and finally 
you will see the chapter: Propia and CHR.

What a kind man explained to me from swi-prlog list (I don't put his address 
to respect him) about CHRs and Prolog was that:

The thing for you to be aware of is that this code combines basic prolog code 
with CHR code.
Basic prolog code is

   s(B,C,D) :- s1, s2, s3.

The logical interpretation is that s is true when s1, s2 and s3 are true.
The execution is to evaluate the parameters in order.

CHR code looks like this:

constraint1, constraint2 <=> test | prolog_code, constraint3.
constraint1, constraint2 ==> test | prolog_code.

The first line says, if constraint1 and constraint2 exist, and test is true, 
then drop
constraint1 and constraint2, evaluate prolog_code, and add constraint3.  The 
second line
says, if constraint1 and constraint2 exist, and test is true, then evaluate 
prolog_code (and
drop nothing).

Take care, 
-_· manou
Received on Tue Nov 07 2006 - 09:01:56 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:57 CET