Prolog is a non-procedural logic based language.
Prolog involves building up a knowledge base
(database) where relationships are represented.
Prolog then uses a built-in facility in order to
draw logical conclusions from a user's inputs.
For example, if we pose the question "Is John the father of Sam?" The database then searches its
list of facts and returns an answer.
| Prolog
query |
Database |
Result |
| ?
father(John, Sam) |
Father(Terry,
Sue)
father(Terry, John)
father(John,
Sam)
female(Sam) |
Yes |
|
|
|