[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incomplete lists in Prolog

From: Alexandre Saidi
Subject: Re: Incomplete lists in Prolog
Date: Thu, 07 May 2009 09:46:51 +0200
User-agent: Thunderbird (Macintosh/20090302)

Hi all,
This is not a real answer, but a remark.

The question was addressed in PrologIII with constraints overs the lists (and hence over the strings).

An exemple is (so called Marseille syntax)

    Z :: 10, <1,2,3>.Z = Z.<2,3,1>

i.e :   the list Z is of the length 10 and,
        the equation (constraint) to be satisfied is such that :
                <1,2,3>.Z : the list containing <1,2,3> put before Z in a list must be equal to
                Z.<2,3,1> :    the  same  Z put before the list <2,3,1>

    => a solution is Z=<1,2,3,1,2,3,1,2,3,1>

May be the key feature   here is the notion of concatenation (append) instead of the "cons" constructor used in Prolog std (inherited from Lisp).

But as I know, PrologIII contains a special solver over what is called the monoide space (actually a solver over finite trees). Many research works was done  on the  "associative unification" with linguistic applications.

I guess : adding that feature to Gprolog would be a big task.

Jasper Taylor a écrit :
Hi all,
We are used to being able to create a list with a 'tail' that may contain zero or more uninstantiated elements, using syntax like L = [a, b, c | Tail]. But why should we not have a list with a section at the start or in the middle, maybe even more than one such section, containing 0 or more uninstantiated elements? If you go:
L = [a, b, c | Tail], append(L, [d, e, f], L2),
you get a series of solutions with Tail instantiated to different length lists. But why shouldn't you get a single solution, something like:
L2 = [a,b,c, '$opening', d,e,f],
which would then unify with any list starting with [a,b,c] and finishing with [d,e,f] ? I don't see what is logically different about the end of a list from its start or middle, that a representation of an unknown number of elements should be allowed there.

Users-prolog mailing list

Alexandre Saidi
Maitre de Conférences
Ecole Centrale de Lyon-Dép. MI
Tél : 0472186530, Fax : 0472186443

reply via email to

[Prev in Thread] Current Thread [Next in Thread]