[net.micro.pc] Turbo Prolog questions

ted@imsvax.UUCP (Ted Holden) (08/14/86)

        Has anyone gotten good with Turbo Prolog yet?  I kind of need
help with two of the items in the manual.  First, I was able to get
sample program 25 (the one which was screwed up from jump) to work after
a fashion via:

             /* Program 25 */
domains
    list = integer*
predicates
    member(integer,list)
    intersect(list,list,list)
clauses
    member(X,[X|_]).
    member(X,[_|Y]):- member(X,Y).

    intersect([],_,_).
    intersect([H|T],Y,[H|T2]):-
        member(H,Y),intersect(T,Y,T2).


which, given the goal "intersect(X,[1,2,3],[2,3,5,6,7])", yeilds three
solutions:

[],
[2],
[2,3]

only the last of which you want.  Any better solutions?

Secondly, does anyone understand the meaning or usage of the predicate
"moredata(file)" in the sample code on page 141?  The same thing is done
on the next page, the predicate being called "repeat" there.
Any help would be appreciated.

Ted Holden