Which property is common to functional programming languages and logic…
2012
Which property is common to functional programming languages and logic programming languages?
Answer: A. Both are declarative — ConceptDeclarative programming describes what relationship or result a computation should establish, without prescribing a fixed sequence of state-changing…
- A.
Both are declarative
- B.
Both are based on λ-calculus
- C.
Both are procedural
- D.
Both are functional
Attempted by 60 students.
Show answer & explanation
Correct answer: A
Concept
Declarative programming describes what relationship or result a computation should establish, without prescribing a fixed sequence of state-changing commands. Functional programming expresses computation through function evaluation, while logic programming expresses facts, rules, and queries.
Application
The question asks for a property shared by both paradigms. Functional and logic programming are both conventionally grouped under declarative programming because each emphasizes the specification of a result or relation rather than an imperative command sequence.
Contrast
λ-calculus is the principal formal foundation of functional programming; logic programming is founded on formal logic and inference.
Procedural programming organizes computation as explicit ordered operations and state changes, which is not the shared classification here.
Functional programming names one of the two paradigms, whereas logic programming uses facts, rules, and queries rather than functions as its defining model.
Cross-check
University programming-language curricula classify functional programming and logic programming as the two major declarative paradigms, while distinguishing their formal foundations.
Result
Therefore, the common property is: both are declarative.