He is widely recognized as the creator of Prolog and drove its practical implementation for natural language processing.
Alain Colmerauer
The full phrase that the abbreviation “Prolog” stands for.
PROgrammation en LOGique
Programming in Logic
What are the three basic constructs used to build programs in Prolog?
facts, rules, and queries
This specific symbol must be used at the end of every Prolog statement to terminate a clause or query
(.) Period
It is the combination of an atom and its arity used to name compound terms
Functor
Prolog is classified as an imperative programming language because the programmer specifies exactly how to compute a result
False
Prolog is an example of a declarative language.
Prolog describes what the problem is and how to solve it
Variables in Prolog must always begin with an uppercase letter or an
underscore (_).
True
Prolog uses traditional for and while loops to perform repetitive tasks.
False.
Prolog uses recursion
The “Cut” operator, which is used to prevent backtracking, is represented by the exclamation mark symbol (!).
True
What does Cut(!) operator do in Prolog?
It is used to freeze or stop the search for solutions.
It will also not allow backtracking
What is backtracking in Prolog?
This means when the language hits a dead end when finding a solution, it automatically goes back to the last place where it had a choice and tries a different path
The standard file extension for Prolog source files is typically .pl or .pro.
True
What is the file extension for Prolog
.pl or .pro
When was Prolog developed and by whom?
1970s. Released in 1972
Alain Colmerauer,
Phillippe Roussel
Robert Kowalski
What is the structure of Prolog?
Consist of a database of “facts” and “rules”.
User interact with the language by providing “goal statements” to query the database
Prolog’s Applications?
Artificial Intelligence,
NLP,
Intelligent database management systems
What are the two kinds of statements that populate a Prolog database?
Facts Statements
Rule Statements
Define Facts and Rule statements in Prolog
Facts statements - define known truths or relationships in the database
Rules statements - define logical rules that infer new facts based on existing ones
what query can invoke the output?
% — Facts —
% These define simple truths in the database.
dog(ringgo). % ringgo is a dog
dog(georgia). % georgia is a dog
% — Rules —
% These define logical relationships (If/Then).
% Kaye owns a Pet IF that Pet is a dog.
owns(kaye, Pet) :-
dog(Pet).
% Who loves What IF Who owns What.
loves(Who, What) :-
owns(Who, What).
-? loves(Who, What)
Given the facts, what is the result of the query?
friend(ace, mark).
friend(mark, jude).
Query:
?- friend(ace, X), friend (X, jude).
X = mark
Given the facts and rules, what is the result of the query?
is_compsci(ace).
is_compsci(ecie).
is_nursing(alecs).
is_business(sofia).
not_compsci(X) :- + is_compsci(X).
Query:
?- not_compsci(sofia).
true
If a rule is defined as follows, what is the result of the query?
double(X, Y) :- Y is X * 2
Query:
?- double(10, Result).
Result = 20
What is the latest stable version of prolog?
SWI-Prolog version 10.0
Application Areas
Semantic Web and Knowledge Graphs