🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.prolog
1 messages
1 total messages Started by Shashank Sun, 08 Aug 1999 00:00
Help solving a prolog problem
#4315
Author: Shashank
Date: Sun, 08 Aug 1999 00:00
15 lines
1120 bytes
 Use the process of resolution and unification to derive F <- T from

quantity( _ ,[],0) <- T.
quantity(X,[X|Y],Z) <- quantity(X,Y,Z1), Z is Z1+1.
quantity(X,[Y|Z],T) <- not X == Y, quantity(X,Z,T).
F <- quantity(3, [1,2,3,3], 2).

Briefly explain each step (one or two lines of explanation for each step is
sufficient). Give new names to
variables such as Z and Z1, when they have to be reference more that once on
the same line, e.g. Za,
Zb, ..., Z1a, Z1b, ...

Thanks.
sowmya.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads