Solve simple Task
€8-30 EUR
Plačilo ob prevzemu
The following facts and rules are known about four locations a, b, c, and d:
Facts: In a it is snowing. In b, it is raining.
Rules:
- If it is raining or snowing in a place, then there is precipitation in that place.
- If it is snowing in a and there is precipitation in c, then it is snowing in b.
- If there is precipitation in a and in b, then it snows in c.
- If there is rain in a and snow in b, then there is precipitation in c.
- If it snows in a and in b, then it rains in d.
- If it rains in a and in b and there is also precipitation in c, then it snows in
in d.
- If there is precipitation in a and rain in both c and d, then it
it rains in a.
a) Analyze the above representation first without prologue and argue
the given facts and rules, in which of the places a, b, c and d there is precipitation.
precipitation exists.
b) Now model the above scenario as a Prolog knowledge base with pr¨adicates rain, snow and precip.
c) Use Prolog to determine all locations with the query ?-precip(Place),
where there is precipitation. What answers do you get if you instruct Prolog with ;
to determine all valid results for this query? Compare ¨
the return values with your own reasoning from subtask (a). ¨
d) Execute the Prolog solution strategy again by hand for the query ¨
question ?-precip(Place). to find out why Prolog does not find all your results.
results. Describe the reason briefly in a few words.
ID projekta: #32085094
Več o projektu
1 freelancer ponuja za povprečno €30 na tem delu
Hello, I am interested in logic programming. I have been programming in Prolog for over 3 yrs. I have implemented many projects and done a lot of tasks. I have implemented an AI logic agent using Prolog. Also, I used Več