Objectmix
Tags Register Mark Forums Read

return all occurances in a list? : PROLOG

This is a discussion on return all occurances in a list? within the PROLOG forums in Programming Languages category; how can I implement "allo" as follows: given: link(a,b). link(a,c). lind(a,d). ?- allo(a,X). X=[b,c,d]. thanks in advance....


Object Mix > Programming Languages > PROLOG > return all occurances in a list?

Reply

 

LinkBack Thread Tools
  #1  
Old 04-06-2009, 09:51 AM
Junior Member
 
Join Date: Apr 2009
Posts: 1
prologSMS is on a distinguished road
Default return all occurances in a list?

how can I implement "allo" as follows:

given:
link(a,b).
link(a,c).
lind(a,d).

?- allo(a,X).
X=[b,c,d].

thanks in advance.
Reply With Quote
  #2  
Old 06-03-2009, 12:42 PM
Junior Member
 
Join Date: Apr 2009
Posts: 1
prologSMS is on a distinguished road
Default Re: return all occurances in a list?

I found the answer using:
findall(Y, link(a,Y), X)

but thanks anyways, this forum is DEAD!
Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
How do I count occurances in an array usenet labview 8 04-22-2008 01:40 PM
how to get # of occurances of a character in a given string usenet Perl 3 09-16-2007 07:21 AM
[JS/CS2] Create Index for All Occurances of a list of Words usenet Adobe Indesign 2 01-18-2007 01:03 PM
counting word occurances usenet Perl 2 06-01-2005 09:49 PM
Counting occurances usenet PHP 1 08-13-2000 08:42 PM


All times are GMT -5. The time now is 08:35 AM.