🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #4247

Re: HELP!!! Please!

#4247
From: #Stefan Bachert
Date: Mon, 05 Mar 1990 12:38
34 lines
1190 bytes
Hello 

>process_entries:-
>	wait(X),
>	abolish(wait,1),
>	goal1(.....),
>	goal2(.....),
>	goal3(.....),
>	goal4(.....).


This type of code is very implementation depending.

As I understood you well, goal1 to goal4 may create a list of
new tasks. This task description are implemented as wait(task).
For this I recommend the following code fragments.

pro:-
	repeat,
	task(X),	% next task
	abolish(wait,1), % clear actual tasks
	pro2(X),!.	% depending on what you expect by end 
			% of task list add a fail

pro2(end):-!.		% no more tasks ( ! is not really neccessary)
pro2(X):-goal1(  ),goal2(  ),goal3(  ),goal4(   ). % does goal4 allways fail ??

task(X):-wait(X),!.	% only the first task will be taken !
task(end).

Hope this will help you


Stefan Bachert
Technical Details
Message-ID: <470006@hpbbi4.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!usc!zaphod.mps.ohio-state.edu!swrinde!ucsd!ucbvax!hplabs!hp-ses!hpbbn!hpbbi4!stefan
References: <1990Mar1.210219.5687@Neon.Stanford.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!usc!zaphod.mps.ohio-state.edu!swrinde!ucsd!ucbvax!hplabs!hp-ses!hpbbn!hpbbi4!stefan
From: stefan@hpbbi4.HP.COM (#Stefan Bachert)
Newsgroups: comp.lang.prolog
Subject: Re: HELP!!! Please!
Message-ID: <470006@hpbbi4.HP.COM>
Date: 5 Mar 90 12:38:31 GMT
References: <1990Mar1.210219.5687@Neon.Stanford.EDU>
Organization: Hewlett-Packard GmbH
Lines: 34