Done By :- -Nesreen Basem -Sara nabil -Rawan Prolog Program
][ 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..
][ ][ ][ History of Prolog ][ First Prolog interpreter by :- Colmerauer & Roussel
][ ][ ][ History of Prolog ][ Implementation of DEC10 compiler by Warren
][ ][ ][ History of Prolog ][ Definite Clause Grammars implementation by Pereira & Warren
][ ][ ][ History of Prolog ][ Prolog grows in popularity especially in Europe & Japan
][ ][ ][ History of Prolog ][ Prolog used to program natural language interface in International Space Station by NASA
][ 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..
][ 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..
][ 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..
][ Kind’s of Prolog ][ 1- SWI prolog. 2- NB prolog. 3- YAP prolog. 4- GNU prolog. 5- XPCE prolog. 6- EZY prolog.
][ ][ ][ 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..
][ ][ ][ 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..
][ Prolog Syntax ][ - What exactly are facts, rules & queries built out of ?! Terms Simple Terms Variables Numbers Terms Simple TermsComplex Terms ConstantsVariables NumbersAtoms
][ Example ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda).
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact rule
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact rule
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). fact rule head body
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-playsAirGuitar(mia). yes ?-
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-playsAirGuitar(mia). yes ?-playsAirGuitar(maya). no
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-happy(yolanda). yes ?-
][ Cont. ][ happy(yolanda). listens2music(mia). listens2music(yolanda):- happy(yolanda). playsAirGuitar(mia):- listens2music(mia). playsAirGuitar(yolanda):- listens2music(yolanda). ?-happy(yolanda). yes ?-sad(mia). no
][ 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.
Thank you all for listen =)