How to list multiple objects from facts

16 views
Skip to first unread message

Diogo Boto

unread,
May 20, 2015, 1:26:46 PM5/20/15
to swi-p...@googlegroups.com
Hello! I'm gueating some troble in listing elements from facts. How can I use a findall function to creat a list like this:

bus [14-00]
plane [4-6]
bus [9-19]
train [8-12]

I'm trying this like this: findall(X-[Y/Z],connection(O,D,X,Y,Z,_),schedule).
Can you give me some advice?





 




 

Barbara Knox

unread,
May 20, 2015, 10:24:47 PM5/20/15
to Diogo Boto, swi-p...@googlegroups.com
Here are a couple hints:

Review the distinction between _constants_ (aka atoms) and _variables_.

Use the proper Prolog terminology. Prolog is not C; findall is not a
"function", it's a "predicate".

HTH.

--
---------------------------
| BBB b \ Barbara at LivingHistory stop co stop uk
| B B aa rrr b |
| BBB a a r bbb | ,008015L080180,022036,029037
| B B a a r b b | ,047045,L014114L4.
| BBB aa a r bbb |
-----------------------------
Reply all
Reply to author
Forward
0 new messages