Become a part of the TranceAddict community!Frequently Asked Questions - Please read this if you haven'tSearch the forums
TranceAddict Forums > Other > Technology & Gadget Zone > anyone knows prolog?
  Last Thread   Next Thread
Share
Author
Thread    Post A Reply
3xx3r7
Speedy J addict



Registered: Jan 2004
Location: with your mom
anyone knows prolog?

here's a problem.

i have a list of facts like this:

fact(x, y).
fact(b, a).
fact(d, c).
fact(z, q).

i need to write a predicate where i input a list of first items and it will spit out a list of corresponding second items, e.g. pred(X, [x, d]). would output X = [y, c].

also, it should be bidirectional, i.e. pred([y, q, a], X). spits out X = [x, z, b].

so far i have is the basic list behaviour:

member(X, [X|Y]).
member(X, [B|Y]) :- member (X,Y).


___________________
Blip, blip, blip...

Old Post Apr-10-2007 18:04  Ukraine
Click Here to See the Profile for 3xx3r7 Click here to Send 3xx3r7 a Private Message Visit 3xx3r7's homepage! Add 3xx3r7 to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Mmanu
Green Pea



Registered: Sep 2006
Location: pas loin

Old Post Apr-15-2007 00:39  France
Click Here to See the Profile for Mmanu Click here to Send Mmanu a Private Message Add Mmanu to your buddy list Report this Post Reply w/Quote Edit/Delete Message
malek
drinks your milkshake!



Registered: Nov 2001
Location: Montréal

man I wish you asked me this question like 5 years ago, we were doing some Prolog at university!

Very intresting language, I kind of liked it.

but now i'm old and my memory is gone


___________________
[/IMG]http://i54.tinypic.com/ngycqo.png[/IMG]

Old Post Apr-15-2007 07:45 
Click Here to See the Profile for malek Click here to Send malek a Private Message Visit malek's homepage! Add malek to your buddy list Report this Post Reply w/Quote Edit/Delete Message

TranceAddict Forums > Other > Technology & Gadget Zone > anyone knows prolog?
Post New Thread    Post A Reply

 
Last Thread   Next Thread
Click here to listen to the sample!Pause playbackid this awesome tune (Simon and Shaker) [2007] [1]

Click here to listen to the sample!Pause playbackEstima - "Hitman's Paradise" (Radio version) [2001]

Show Printable Version | Subscribe to this Thread
Forum Jump:

All times are GMT. The time now is 14:25.

Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
HTML code is ON
vB code is ON
[IMG] code is ON
 
Search this Thread:

 
Contact Us - return to tranceaddict

Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
Support TA!