Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run the syntax for this prolog [need help]

Status
Not open for further replies.

finzzz

Programmer
Jul 18, 2010
1
ID
hey all senior, im newbie here need our help.

i got some problem to run this code, because i dont know the syntax for run this code in prolog.

%order, name, instrument, gender

List_of_musician = [musician(1,_,_,_),musician(2,_,_,_),musician(3,_,_,_), musician(4,_,_,_)],

member(musician(_,anita,_,-1),List_of_musician),
member(musician(_,bernard,_,1),List_of_musician),
member(musician(_,cynthia,_,-1),List_of_musician),
member(musician(_,donna,_,1),List_of_musician),

member(musician(x,bernard,_,1),List_of_musician),
member(musician(y,_,piano,_),List_of_musician),
x is y-2 || x is y+2,

member(musician(a,donna,_,1),List_of_musician),
member(musician(b,_,c,_),List_of_musician),
a is b-2 || a is b+2,
c\=flute,

member(musician(s,anita,_,-1),List_of_musician),
member(musician(t,_,biola,_),List_of_musician),
t is (s+1) mod 4,

member(musician(u,cynthia,_,-1),List_of_musician),
member(musician(v,_,w,_),List_of_musician),
v is (u+1) mod 4,
w\=drum,

member(musician(_,_,flute,e),List_of_musician),
member(musician(_,_,drum,f),List_of_musician),
e is -1*f.


can someone help me? thx before
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top