COMPUTER FUNDAMENTALS

COMPUTER SOFTWARE

PROGRAMMING LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Prolog is an example of what type of programming paradigm?
A
Logic
B
Imperative
C
Object oriented
D
Procedural
Explanation: 

Detailed explanation-1: -Prolog or PROgramming in LOGics is a logical and declarative programming language. It is one major example of the fourth generation language that supports the declarative programming paradigm.

Detailed explanation-2: -Prolog programs have a sequence of clauses. Facts or rules are described by these clauses. Example of facts is dog(rottweiler) and cat(munchkin). They mean that ‘rottweiler is a dog’ and ‘munchkin is a cat’.

Detailed explanation-3: -Prolog is a logic programming language, whereas Haskell is a functional language. Functional languages are based on the concept of a function which takes a number of arguments and computes a value. Prolog, on the other hand, does not have functions. Instead, predicates are used to prove a “theorem".

Detailed explanation-4: -Prolog mainly uses the declarative programming paradigm but also incorporates imperative programming. It is designed for symbolic computation and inference manipulation. Its logical rules are expressed in terms of relations and take the form of Horn clauses.

Detailed explanation-5: -Prolog is a programming language based on predicate logic. A Prolog program attempts to prove a goal, such as brother(Barney, x), from a set of facts and rules.

There is 1 question to complete.