Prolog
Prolog
Prolog (from French programmation en logique, "programming in logic") is a declarative logic programming language primarily used in artificial intelligence, computational linguistics, and symbolic reasoning. Unlike imperative languages, Prolog programs express what is true rather than how to compute it, relying on a built-in inference engine to derive answers.
History
Prolog was first conceived in the early 1970s by Alain Colmerauer and Robert Kowalski. Colmerauer’s group at the University of Aix-Marseille was researching natural language understanding, and Kowalski, at the University of Edinburgh, was working on logic-based theorem proving. Their collaboration produced the first Prolog interpreter in 1972. The language gained prominence in the 1980s as a core tool for the Japanese Fifth Generation Computer Systems project. The Edinburgh Prolog dialect later became the basis for the ISO Prolog standard.
Features
- Declarative syntax: Programs consist of facts (ground assertions) and rules (implications) written in first-order logic.
- Unification: The language uses pattern matching to bind variables to terms during resolution.
- Backtracking: The Prolog engine automatically explores alternative solutions when a query fails.
- Recursion: Recursive rules are the primary means for iteration, as Prolog lacks classical loops.
- Built-in search: The interpreter implements SLD resolution (a form of Horn clause deduction) to answer queries.
Prolog is widely used in expert systems, theorem provers, and natural language processing applications. Its influence extends to constraint logic programming and answer set programming.