Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

DO NOT GOOGLE ANSWER!!!!! Write the statements in Exercise 4.4 as Prolog clauses

ID: 3530204 • Letter: D

Question


DO NOT GOOGLE ANSWER!!!!!

Write the statements in Exercise 4.4 as Prolog clauses, in the order given. What answer does Prolog give when the query "Is it freezing?" The query "Is it raining?" Why? Can you rearrange the clauses so the Prolog can give better answers? Question: 4.4 : Write the following statements in the first-order predicate calculus: If it is raining or snowing, then there is precipitation. If it is freezing and there is precipitation, then it is snowing. If it is not freezing and there is precipitation, then it is raining. It is snowing. precipitation rightarrow raining or snowing, snowing rightarrow freezing and precipitation, raining rightarrow not freezing and precipitation, snowing.

Explanation / Answer

precipitation(X) :- raining(X);snowing(X).
snowing(X,Y) :- (freezing(X), precipitation(Y)).
raining(X,Y) :- (not(freezing(X)), precipitation(Y)).
precepitation(snowing).

Is the Prolog code written in the order given. When queried with