Re: findall
- From: bart demoen <bmd@xxxxxxxxxxxxxx>
- Date: Sun, 17 Feb 2008 17:08:28 +0100
On Sun, 17 Feb 2008 07:33:07 -0800, Mark Tarver wrote:
Can findall be efficiently implemented in pure Prolog?
The answer depends on what you consider as pure Prolog - and what you
still consider efficient.
In Prolog with assert and retract, it is possible, actually, that's how
it has been done many times (sometimes with a variant of assert, named
record).
Without assert and retract (or any other magic [*]) the full
semantics of findall is impossible to implement, AFAIK, even if you
give up on efficiency.
[*] e.g. "engines"
You can do something that has the findall flavour in almost pure Prolog
(you need cut or if-then-else) when you just want all different answers,
without their multiplicity.
What is the origin of your question ?
Cheers
Bart Demoen
.
- References:
- findall
- From: Mark Tarver
- findall
- Prev by Date: findall
- Next by Date: Re: findall
- Previous by thread: findall
- Next by thread: Re: findall
- Index(es):
Relevant Pages
|
|