Re: Vertex List from Points
- From: "Brian Hulley" <brianh@xxxxxxxxxxxx>
- Date: 15 May 2005 22:38:40 -0700
eclifter wrote:
> I am a total newbie to prolog but have some understanding of
graphics.
> I have a set of points which are required to be in the form:
>
> Point(a)
> Point(b)
> Point(c)
> Point(d)
I assume you mean point(a), point(b) etc since identifiers starting
with an uppercase letter are variables in Prolog - if so, then you can
use:
?- findall(P, point(P), ListOfPoints).
For other situations where you need to get things from the database
into a list you can also use setof/3 or bagof/3 but these are slightly
more complicated to understand than findall/3 above.
Regards, Brian.
.
- References:
- Vertex List from Points
- From: eclifter
- Vertex List from Points
- Prev by Date: Vertex List from Points
- Next by Date: Re: f(a:-b,c) or f((a:-b),c) - How should compound args be parsed?
- Previous by thread: Vertex List from Points
- Index(es):
Relevant Pages
|
|