🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3189

Re: Programming Quickie

#3189
From: Lee Naish
Date: Wed, 30 Mar 1988 07:51
13 lines
794 bytes
In article <1600011@otter.hple.hp.com> ijd@otter.hple.hp.com (Ian Dickinson) writes:
>	exactly_one( +X, ?Y )
>	is true if X contains Y,  Y satisfies p/1 and all of the other
>	Y' contained by X satisfy q/1.

	% NU-Prolog solution (will generate X or Y or both)
exactly_one(X, Y) :-
	solutions(Y0, X contains Y0, YList),	% like setof
	delete(Y, YList, Remainder),
	p(Y),
	all Y1 member(Y1, Remainder) => q(Y1).	% any formatting ideas?

	lee
Technical Details
Message-ID: <2644@mulga.oz>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!munnari!mulga!lee
References: <1600011@otter.hple.hp.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!munnari!mulga!lee
From: lee@mulga.oz (Lee Naish)
Newsgroups: comp.lang.prolog
Subject: Re: Programming Quickie
Message-ID: <2644@mulga.oz>
Date: 30 Mar 88 07:51:50 GMT
References: <1600011@otter.hple.hp.com>
Reply-To: lee@mulga.UUCP (Lee Naish)
Organization: Comp Sci, Melbourne Uni, Australia
Lines: 13