Question: Given the following prolog program, answer the following queries? /* Comments in prolog + represents not equal to */%single line comments day(sunday). day(monday). day(tuesay). day(Wednesday).
Given the following prolog program, answer the following queries?
/* Comments in prolog \+ represents "not equal to" */%single line comments day("sunday"). day("monday"). day("tuesay"). day("Wednesday"). day("thursday"). day("friday"). no_office("sunday"). no_office("saturday"). take_leave("monday"). visit_mom(X): - no_office(X) | take_leave(X). Interpret the queries and guess(!) the answer(s) produced by the program: day("Holiday"). day(X). visit_mom(X). visit_mom(X). provided you have changed the rule with this: visit_mom(X):- no_office(X), take_leave(X). define a new rule "working_day(X)"to detect the days _that are not holidays
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
