[comp.object] Constraint Logic Programming

jdudeck@polyslo.CalPoly.EDU (John R. Dudeck) (01/13/90)

In article <21140@pasteur.Berkeley.EDU> faustus@yew.Berkeley.EDU (Wayne Christopher) writes:
>Speaking of constraint-solving systems, has anybody had any experience
>using constraint logic programming (CLP) systems?  Alan Borning at U.
>Washington is working on this stuff, and so are some people at Monash
>University in Australia.  Is there anybody else?  Has CLP been applied
>to any real problems?

Some of us read this newsgroup to learn about things we otherwise don't
encounter.  Would somebody like to give a 2-paragraph explanation of
what CLP is, say, compared to PROLOG?

Does the TRILOGY language from Complete Logic Systems, Vancouver, B.C.,
have anything to do with CLP?


-- 
John Dudeck                           "You want to read the code closely..." 
jdudeck@Polyslo.CalPoly.Edu             -- C. Staley, in OS course, teaching 
ESL: 62013975 Tel: 805-545-9549          Tanenbaum's MINIX operating system.

jug@itd.dsto.oz (Jim Grundy) (01/18/90)

From article <25ae8b54.b1d@polyslo.CalPoly.EDU>, by jdudeck@polyslo.CalPoly.EDU (John R. Dudeck):
> 
> Some of us read this newsgroup to learn about things we otherwise don't
> encounter.  Would somebody like to give a 2-paragraph explanation of
> what CLP is, say, compared to PROLOG?
> 
> Does the TRILOGY language from Complete Logic Systems, Vancouver, B.C.,
> have anything to do with CLP?

Your everyday logic programming language like PROLOG operates with a 
search based operational sematics (resolution in the case of PROLOG).
This allows PROLOG programs to solve a fairly narrow class of logic problems.
Now constraint logic programming adds to this an array of domain specific
problem solving algorithms, for say the domains of real numbers and sets.
For example a gausian elimination engine may be added for the purpose of
solving systems of equations.   The ai comunity has developed a bunch of
contraint solvers over other domains over the years.

Lets look at the following example in some sort of hybred prolog that also
contains a gausian elemination engine.

   resistor(V, I, V / I).
   parrallel(V, R1, R2, I1 + I2) :- resistor(V, I1, R1), resistor(V, I2, R2).
   serial(I, R1, R2, V1 + V2) :- resistor(V1, I, R1), resistor(V2, I, R2).
   par_ser(I, R1, R2, R3, R4, V1 + V2) :- parrallel(V1, R1, R2, I),
										  parrallel(V2, R3, R4, I).

Now par_ser(5, 10, 10, 10, 10, A) evaluates to A=50.
This examle is a molested version of an example appearing in:
  Darlington J. & Gou Yi-ke 1988, Towards Constraint Functional Programming,
  Department of Computer Science Imperial Colledge, London.

Anyway I think thats what clp is anyone else got a better idea?

JIM