title: The Craft of Prolog (Logic Programming)
author:  Richard A. O'Keefe 
description: Richard A. O'Keefe is Lecturer in the Department of Computer Science at the Royal Melbourne Institute of Technology. He is also a consultant to Quintus Computer Systems, Inc.
zlib_text: An introduction to logic programming
  through Prolog
  Author: Michael Spivey
  Draft date: 22/11/2008
  Copyright c⃝ Prentice–Hall International 1995
  To appear in February 1996.
  i
  
  Contents
  Preface
  viii
  1
  Introduction
  1
  1.1
  Introducing logic programming
  2
  2
  Programming with relations
  13
  3
  Recursive structures
  21
  3.1
  Lists
  21
  3.2
  Deriving facts about append
  25
  3.3
  More relations on lists
  29
  3.4
  Binary trees
  32
  4
  The meaning of logic programs
  35
  4.1
  Syntax
  36
  4.2
  Truth tables
  39
  4.3
  Adding functions and variables
  41
  4.4
  Substitutions
  42
  5
  Inference rules
  47
  5.1
  Substitution and ground resolution
  47
  5.2
  Refutation
  50
  5.3
  Completeness
  52
  6
  Uniﬁcation and resolution
  55
  6.1
  Uniﬁcation
  57
  6.2
  Resolution
  62
  6.3
  Derivation trees and the lifting lemma
  64
  6.4
  Completeness of resolution
  66
  v
  
  vi
  Contents
  7
  SLD–resolution and answer substitutions
  69
  7.1
  Linear resolution
  70
  7.2
  SLD–resolution
  73
  7.3
  Search trees
  76
  7.4
  Answer substitutions
  80
  8
  Negation as failure
  85
  8.1
  Negation in goals
  85
  8.2
  Negation