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
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