Bratko, Chapter 1: Overview of Prolog Prolog: PROgramming in LOGic [1970] - Prolog is a declarative language - declarative meaning of a program defines WHAT the output should be - procedural meaning of a program defines HOW the output is obtained - Prolog uses deduction (via resolution) in subset of first-order predicate logic - emphasis on declarative, but some procedural needed - e.g., Factorial in procedural and declarative forms - e.g., rule-based deduction - Prolog manipulates relations - parent = {(pam,bob),(tom,bob),...} - (pam,bob) is an instance of parent, written parent(pam,bob) - Prolog manipulates CLAUSES - CLAUSE - disjunction of literals - A,B,C -> D is ~A v ~B v ~C v D - (A) is (True -> A) is False v A - (?- A) is (~A) - consists of a head and a body (comma-separated list of goals) - rules, head and body - facts, head but no body - questions, body but no head - variables are universally quantified, forall - procedure - set of clauses about the same predicate - recursive procedure: stopping and recursive conditions - example - order (getting procedural) - how Prolog answers questions - unification and backtracking - show a tree