— Ch. 1 · Origins And Development History —
Prolog.
~6 min read · Ch. 1 of 6
Alain Colmerauer and Philippe Roussel created the first Prolog system in 1972 at the Artificial Intelligence Group of the Faculty of Sciences of Luminy. Their work emerged from Aix-Marseille II University in France during a period when logic programming was still an emerging field. The name Prolog came from Philippe Roussel, who chose it based on his wife's suggestion as an abbreviation for Programming in Logic. This early version relied on Robert Kowalski's procedural interpretation of Horn clauses to reconcile declarative knowledge representation with procedural methods popular in North America. Gerard Battani and Henri Meloni wrote the initial interpreter using Fortran, establishing the foundation for future development. David H. D. Warren later took this interpreter to the University of Edinburgh where he implemented an alternative front-end that defined the Edinburgh Prolog syntax used by most modern systems. Warren also developed the first compiler for Prolog called DEC-10 Prolog in collaboration with Fernando Pereira. His work generalized these ideas into what became known as the Warren Abstract Machine. European AI researchers favored Prolog while American researchers preferred Lisp, creating nationalistic debates about language merits throughout the 1970s and 1980s. The Fifth Generation Computer Systems project later drove much modern development by creating Kernel Language variants for their operating systems.
Core Syntax And Logical Semantics
Prolog programs express logic through relations defined by terms, which serve as the language's single data type. Terms include atoms starting with lowercase letters or guarded by quotes like red or Taco. Numbers appear as floats or integers, with most major systems supporting arbitrary length integer numbers. Variables begin with uppercase letters or underscores and function as placeholders for arbitrary terms. Compound terms combine a functor atom with argument terms inside parentheses, such as person_friends(zelda,[tom,jim]). Lists form ordered collections denoted by square brackets containing comma-separated terms. Rules follow the Head :- Body structure read as Head is true if Body is true. Facts represent clauses with empty bodies equivalent to rules using the built-in predicate true/0. A query initiates computation by running against these defined relations. The engine attempts resolution refutation of the negated query to find variable instantiations making the union false. This process allows Prolog to handle database operations, symbolic mathematics, and language parsing applications effectively. Impure predicates enable deliberate side effects like printing values when logical paradigms prove inconvenient. Pure Prolog remains restricted to Horn clauses while extensions add extralogical features for practical programming needs.