I'm a begginer at Prolog and I need some help with this exercise, this is the knowledge base provided:
album(‘R. Stevie Moore’, ‘Manuscription’).
album(‘Lane Steinberg’, ‘Manuscription’).
album(‘R. Stevie Moore’, ‘The Yung & Moore Show’).
album(‘Yukio Yung’, ‘The Yung & Moore Show’).
album(‘Jessie Evans’, ‘Autonervous’).
album(‘Bettina Koster’, ‘Autonervous’).
album(‘Lucia Pamela’, ‘Walkin on the moon’).
album(‘Shooby Taylor’, ‘The Human Horn’).
album(‘Tiny Tim’, ‘God Bless Tiny Tim’).
album(‘The Legendary Stardust Cowboy’, ‘Rock-It to Stardom’).
vinil(‘Rock-It to Stardom’).
vinil(‘Walking on the Moon’).
cd( ‘God Bless Tiny Tim’).
cd(‘Walking on the Moon’).
cd(‘Autonervous’).
cd(‘Manuscription’).
cassette(‘The Human Horn’).
cassette(‘The Yung & Moore Show’).
mp3(‘Walkin on the Moon’).
I need to make a query that will return to me all the albums that were made by only one musician.
Thanks for your help :)
findall/3. Give it a shot and show us what you come up with. - Daniel Lyonsfindall/3command yet, sorry =/. I Have tried things likealbum(X,B),album(Y,C), B \= C.But obviously that didnt work xD. - Niammifindall/3, for example: csupomona.edu/~jrfisher/www/prolog_tutorial/2_12.html. Also, you have to just think logically through the problem.album(X,B), album(Y,C), B\=C.says, An album called B made by X and an album C made by Y where B and C are different doesn't describe the query you said you want. Think about what you're wanting in your query. You can ask: return an album made by musician X (translate into Prolog) and usefindall/3to get all of them. Then check if the list obtained has length of1. - lurker