GATE / CS ARCHIVE

GATE CSE 2005 / QUESTION 3

Declarative programming paradigms

Engineering Mathematics & Other Topics · Other Computing Topics · Full GATE CSE 2005 paper

GATE 2005, Q3 1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Other Computing Topics

Question 3, GATE 2005: Common property of logic and functional languages? A procedural; B based on lambda calculus; C declarative; D use Horn clauses.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Logic programming states logical relations, while functional programming expresses computations through functions rather than imperative state-changing instruction sequences. Both are conventionally classified as declarative, C. Lambda calculus is the usual basis for functional programming; Horn clauses are associated with logic programming, not both paradigms.

Logic programs describe facts/rules and functional programs compose function expressions. Both conventionally emphasize what result or relation is specified rather than a sequence of mutable-state commands, hence declarative. Functional foundations commonly use lambda calculus; Horn clauses are associated with logic programming. Neither foundation is common to both simply because both are declarative.

Original paper, page 1