Presentation is loading. Please wait.

Presentation is loading. Please wait.

SAMPLE PROLOG PROGRAM Nourah Alsuqayh.

Similar presentations


Presentation on theme: "SAMPLE PROLOG PROGRAM Nourah Alsuqayh."— Presentation transcript:

1 SAMPLE PROLOG PROGRAM Nourah Alsuqayh

2 Example. Consider the simple problem of getting the directions between cities: The facts are : - AlMadinah is to the north of Makkah . Hail is the north of Riyadh. Also Hail is city. Jeddah is the west of Dammam. Jeddah is the west of Riyadh. Also Riyadah and Jeddah are cities Write these facts in SWI PROLOG.

3 Write a rule based on previous facts that describe the south direction between two cities?
Write a rule based on previous facts and rules that describe the northeast direction between two cities? Convert the below questions to Prolog questions then answer each of them : - IS Riyadh is east of jeddah? - what is the city that has north of riyadh?

4 ANSWER:

5


Download ppt "SAMPLE PROLOG PROGRAM Nourah Alsuqayh."

Similar presentations


Ads by Google