COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED 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 (programming in logic) is a logic-based programming language: programs correspond to sets of logical formulas and the Prolog interpreter uses logical methods to resolve queries. Prolog is a declarative language: you specify what problem you want to solve rather than how to solve it.

Detailed explanation-3: -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-4: -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.