Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!news.sprintlink.net!news.ecrc.de!ecrc!acrab60!thom
From: thom@ecrc.de (Thom Fruehwirth)
Subject: Re: fold/unfold transformations in logic progr
Message-ID: <D8D2H2.7LJ@ecrc.de>
Sender: news@ecrc.de
Reply-To: thom@ecrc.de
Organization: European Computer-Industry Research Centre GmbH.
References: <3ooj78$g12@senator-bedfellow.MIT.EDU>
Date: Wed, 10 May 1995 11:55:50 GMT
Lines: 24

Cheng Hian Goh <chgoh@rombutan.mit.edu> wrote:
   Suppose we have

     A(X,Y) :- G(X,Z),H(Z,Y).
     B(X,Y) :- J(X,Z),H(Z,Y).

   It is conceiveable that the clause

     :- G(m,n),H(n,p),J(q,n)

   can be folded to 

     :- A(m,p),B(q,p)

   (which if you unfold using the same clauses, returns the same thing if you
   are willing to treat "C,C" to be equivalent to "C".)


That is the point: The folding transformation makes only sense if your
logic language will replace "C,C" by "C". With the constraint handling
rules library of ECLiPSe you can do that.

thom

