☰
↑
←
→
🔍
TOC
A "Hands-on" Introduction to
Pure Logic Programming (Pure Prolog)
»
Table of Contents
ON THIS PAGE
Syntax
Slide 2 — Terms: variables, constants and structures
Slide 3 — More on terms
Operators
Slide 4 — Rules and facts (clauses)
Slide 5 — Predicates, programs and queries
Queries
Slide 6 — The declarative meaning of facts and rules
Slide 7 — The declarative meaning of predicates and queries
Slide 8 — "Execution" and semantics
The program running
Slides 9–10 — Running programs, and the top-down operational meaning
Unification
Slide 11 — Unification: one operation with many uses
Slide 12 — Unification, more formally
When it does not work
Slide 13 — The most general unifier
Slide 14 — The unification algorithm
Slide 15 — The unification algorithm: worked examples
Execution, search, and control
Slide 16 — A schematic interpreter (SLD-resolution)
The algorithm, run by hand
Slide 17 — The choices made in standard Prolog
Slide 18 — Search rule and computation rule
Slides 19–21 — Alternative execution paths, and the "normal programming" view
Slide 22 — Continuations, and why Prolog is not slow
Slide 23 — Programs with and without search
Slide 24 — The search tree
Slide 25 — Characterizing the search tree
Slides 26–28 — Depth-first, breadth-first, and choosing between them
Slides 29–30 — Control of search: clause and goal order
Working through the goal-order example by hand
Clause order
Slide 31 — The role of unification in execution
A worked example
Slide 32 — "Modes"
Slide 34 — Pure logic programs: an overview
Programming with data
Slides 35–36 — Database programming
Exercises
Slides 37–40 — Structured data, data abstraction, and
=
Slides 41–42 — Logic programs and the relational database model
Slide 43 — Deductive databases, Datalog and ASP
Recursion
Slide 45 — Recursive programming
Exercises
Slides 46–47 — What about "not equal"?
Slides 48–49 — Types, and recursive types
Recursive types
What does it cost?
Slides 50–53 — Arithmetic, the pure way
less_or_equal
plus
Exercises
Slides 54–57 — Functional syntax
Exercises
Lists
Slides 58–59 — Lists as a recursive type
The two layers of sugar
Unification on lists
The type definition
Slides 60–61 — Append
Slide 62 — One way to understand recursive programs
Slides 63–67 — Reverse, and the cost of getting it wrong
Why the naive version is slow
The accumulating parameter
Measuring the difference
Exercises
Trees, symbols and graphs
Slides 68–69 — Binary trees
Exercises
Slide 70 — Polymorphism
Slide 71 — Recognizing (and generating) polynomials
Slide 72 — Symbolic differentiation
Exercises
Slides 73–74 — Graphs
Exercises
Slide 75 — Automata as graphs
Slide 76 — Adding a stack: pushdown automata
Slides 77–79 — The Towers of Hanoi
Slide 80 — Learning to compose recursive programs
Table of Contents