show the results of running the following code in prolog and the comands you use
ID: 643618 • Letter: S
Question
show the results of running the following code in prolog and the comands you used
List([room(_,_,6,_),room(_,_,7,_),room(_,_,8,_),room(_,_,9,_),room(_,_,10,_)]).
/* room(Room,Plume,Puffs,Guest)*/
Anwser(A) : - List(A),
member(room(den,_,_,pedro),A), /*Rule 1*/
member(room(_,_,8,daniela),A), /*Rule 2*/
member(room(livingroom,mystery-glen,_,callie),A), /*Rule 3*/
member(room(_,desert-flora,7,_),A), /*Rule 4*/
member(room(_,papaya-paradise,P,_),A), /*Rule 5*/
member(room(_,_,R,renee),A), P =:= R+1 /*Rule 5*/
member(room(bathroom,_,B,_),A), P =:= B-1 /*Rule 5*/
member(room(_,sweet-breeze,S,_),A), T== S /*Rule 6*/
member(room(_,KitchenAirFreshener,K,_),A), S =:= K+1 /*Rule 6*/
member(room(_,_,T,Tina),A). /*Rule 6*/
Explanation / Answer
Commands:/* room(Room,Plume,Puffs,Guest)*/
1. Pedro likes the Plume in Callie's den.
2. Daniela's favorite Plume is the one that releases eight puffs per minute.
3.Callie placed the mystery-glen Plume in her living room.
4. The desert-flora Plume releases seven puffs per minute.
5. Each minute, the papaya-paradise Plume releases exactly one puff more than the Plume Renee enjoys but exactly one puff fewer than the Plume located in the bathroom.
6. Each minute, the sweet-breeze Plume releases exactly one more puff than the kitchen air freshener but fewer puffs than the Plume Tina likes.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.