dimanche 10 juillet 2016

two receiver from same sender prolog


My question is "make a PROLOG rule to test whether two receivers have received a message on the same date from the same sender. If true, display the sender and the date, otherwise return false."

query will be like ?message(robert,mark)[receiver]

database is like

%message(Sender, Receiver, Date, Cost_of_sending_a_message)

message(sonny,robert,'2012-05-12',8). message(robert,sarah,'2012-05-12',5). message(julie,mary,'2012-05-12',6). message(fred,nayna,'2012-05-13',6). message(fred,daniel,'2012-05-14',6). message(nayna,lucia,'2012-05-15',3). message(sonny,lucia,'2012-06-04',8).

thanks in advance !


Aucun commentaire:

Enregistrer un commentaire