Skip to main content
QUICK REVIEW

[Paper Review] The Logic Programming Paradigm and Prolog

Krzysztof R. Apt|ArXiv.org|Jul 10, 2001
Logic, programming, and type systems5 references4 citations
TL;DR

This tutorial presents the logic programming paradigm and Prolog as a general-purpose programming language rooted in first-order logic and automated deduction. It explains how unification, backtracking, and logical variables enable computation as deduction, while highlighting Prolog’s strengths in declarative programming and its limitations in control, types, and modularity, with a call for improved successors like Mercury.

ABSTRACT

This is a tutorial on logic programming and Prolog appropriate for a course on programming languages for students familiar with imperative programming.

Motivation & Objective

  • To provide a foundational understanding of logic programming and Prolog for students familiar with imperative programming.
  • To clarify the conceptual shift from theorem proving to computation via unification and logical variables.
  • To examine Prolog’s design choices, including its use of backtracking, cut, and built-ins, and their implications for program correctness and maintainability.
  • To assess Prolog’s strengths and limitations in comparison to imperative and functional paradigms, and to identify areas for future language improvement.

Proposed method

  • Uses first-order logic as the formal basis for defining logic programs and relations.
  • Explains unification as the core computational mechanism, with most general unifiers (MGUs) enabling variable assignment.
  • Describes the resolution process and backtracking as the sole control mechanism in pure logic programming.
  • Illustrates how Prolog extends logic programming with built-in predicates (e.g., arithmetic, cut, if-then-else) and meta-programming facilities.
  • Analyzes the operational semantics of key constructs like negation as failure and cut, and their impact on program behavior.
  • Compares logic programming concepts to imperative programming constructs via a mapping table (e.g., unification ↔ assignment, query ↔ program).

Experimental results

Research questions

  • RQ1How does logic programming realize 'computation as deduction' using first-order logic and unification?
  • RQ2What are the key differences between logic programming and imperative programming in terms of control flow and data flow?
  • RQ3Why is Prolog considered a general-purpose language despite its roots in theorem proving and natural language processing?
  • RQ4What are the main limitations of Prolog in practice, particularly regarding control, modularity, and type safety?
  • RQ5How do meta-programming and higher-order programming in Prolog compare to their counterparts in functional and object-oriented languages?

Key findings

  • Unification is the central computational mechanism in logic programming, enabling automatic variable binding through most general unifiers.
  • Backtracking is the sole control mechanism in pure logic programming, which simplifies the model but limits expressiveness and efficiency.
  • Prolog’s built-in predicates—such as cut, arithmetic operators, and if-then-else—introduce procedural behavior that complicates declarative semantics.
  • The absence of modules and types in the ISO Prolog standard hinders program structuring and reuse, leading to runtime errors that could be caught at compile time.
  • Despite its limitations, Prolog remains widely used due to its elegant integration of first-order logic with computation, and it has inspired successors like Mercury and constraint logic programming.
  • The lack of a standardized successor to Prolog that addresses its shortcomings—such as type safety, modularity, and formal semantics—remains an open challenge in programming language design.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.