Download presentation
Presentation is loading. Please wait.
Published byBritton Stephens Modified over 8 years ago
1
Done By :- -Nesreen Basem -Sara nabil -Rawan Prolog Program
2
][ Introduction ][ - Prolog stands for PROgramming in LOGic,, It is a logic language that is particularly used by programs that use non-numeric objects,, For this reason it is a frequently used language in ”AI”,, where manipulation of symbols is a common task,, Prolog differs from the most common programming’s languages because it is declarative language..
3
][ ][ ][ History of Prolog ][ 19721977198019902005 First Prolog interpreter by :- Colmerauer & Roussel
4
][ ][ ][ History of Prolog ][ 19721977198019902005 Implementation of DEC10 compiler by Warren
5
][ ][ ][ History of Prolog ][ 19721977198019902005 Definite Clause Grammars implementation by Pereira & Warren
6
][ ][ ][ History of Prolog ][ 19721977198019902005 Prolog grows in popularity especially in Europe & Japan
7
][ ][ ][ History of Prolog ][ 19721977198019902005 Prolog used to program natural language interface in International Space Station by NASA
8
][ What is Prolog ?! ][ - Prolog is an extraordinary programming language,, it is classified as a Declarative language.. - The basic concepts it releases on are the “Knowledge Base" & the “Mechanism”,, it uses to obtain results and answer user’s queries.. - Prolog has NO for, while, repeat loops,, It uses the recursion techniques to substitute all these mentioned..
9
][ Basic idea of Prolog ][ - Describe the situation of interest.. - Ask a question.. -- Prolog logically deduces new facts about the situation we described.. - Prolog gives us its deductions back as answers..
10
][ Prolog programs can be interpreted in 2 ways ][ 1- declaratively :- -Tell the computer what problem we want to solved.. Such as [ Prolog,, ML,, LISP ] programs.. 2- procedurally :- -Tell the computer how to solve the problem.. Such as [ C++,, Java,, Pascal ] programs..
11
][ Kind’s of Prolog ][ 1- SWI prolog. 2- NB prolog. 3- YAP prolog. 4- GNU prolog. 5- XPCE prolog. 6- EZY prolog.
12
][ ][ ][ Prolog Advantages ][ 1- It’s a Logical Programming language.. 2- It is easy to read and write programs which build structures.. 3- It is easy to build tables and databases while a program is running..
13
][ ][ ][ Prolog Disadvantages ][ 1- Limited sphere of usefulness.. 2- Not a “pure” logical language.. 3- It don’t have the fancy graphics the youngsters are raving about.. 4- It won’t make you popular with the ladies..
14
][ Prolog Syntax ][ - What exactly are facts, rules & queries built out of ?! Terms Simple Terms Variables Numbers Terms Simple TermsComplex Terms ConstantsVariables NumbersAtoms
15
][ Example ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda).
16
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact
17
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact
18
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact rule
19
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact rule
20
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact rule head body
21
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-
22
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-playsAirGuitar(mia). yes ?-
23
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-playsAirGuitar(mia). yes ?-playsAirGuitar(maya). no
24
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-
25
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-happy(yolanda). yes ?-
26
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-happy(yolanda). yes ?-sad(mia). no
27
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-happy(yolanda). yes ?-sad(mia). ERROR: predicate sad/1 not defined.
28
Thank you all for listen =)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.