Arizona State University (ASU) CSE240 Introduction to Programming Languages Midterm Practice Exam

Session length

1 / 20

Which programming paradigm expresses computation in terms of logic predicates?

Functional

Logic

The choice of logic as the programming paradigm that expresses computation in terms of logic predicates is correct because logic programming revolves around the use of formal logical statements to express relationships and facts about the problem domain. Instead of focusing on the steps or procedures needed to achieve a result, as seen in procedural programming, logic programming allows developers to declare what the solution should satisfy through predicates. These predicates function as logical assertions that can be evaluated to true or false, often used in languages like Prolog.

In this paradigm, the programmer typically specifies a set of facts and rules, and the logic programming system determines how to derive new information from those statements. The use of unification and backtracking are some key features that allow logic programs to search for solutions effectively based on the predicates defined.

Understanding logic programming provides a fundamental perspective on solving problems that can differ significantly from the other paradigms mentioned, such as functional, procedural, or object-oriented programming, which emphasize different aspects of computation and structure.

Procedural

Object Oriented

Next Question
Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy