Book:William F. Clocksin/Programming in Prolog

From ProofWiki
Jump to navigation Jump to search

William F. Clocksin and Christopher S. Mellish: Programming in Prolog

Published $\text {1981}$, Springer-Verlag

ISBN 0 387 58350 5


Contents

Tutorial Introduction
12 Objects and Relationships
13 Programming
14 Facts
15 Questions
16 Variables
17 Conjunctions
18 Rules
19 Summary and Exercises
A Closer Look
211 Constants
212 Variables
22 Characters
23 Operators
24 Equality and Unification
25 Arithmetic
26 Summary of Satisfying Goals
261 Successful satisfaction of a conjunction of goals
262 Consideration of goals in backtracking
263 Unification
Using Data Structures
32 Lists
33 Recursive Search
34 Mapping
35 Recursive Comparison
36 Joining Structures Together
37 Accumulators
38 Difference Structures
Backtracking and the Cut
41 Generating Multiple Solutions
42 The Cut
43 Common Uses of the Cut
432 The cutfail Combination
433 Terminating a generate and test
44 Problems with the Cut
Input and Output
51 Reading and Writing Terms
512 Writing Terms
52 Reading and Writing Characters
521 Reading Characters
522 Writing Characters
53 Reading English Sentences
54 Reading and Writing Files
541 Opening and closing streams
542 Changing the current input and output
543 Consulting
55 Declaring Operators
Builtin Predicates
61 Entering New Clauses
62 Success and Failure
63 Classifying Terms
64 Treating Clauses as Terms
65 Constructing and Accessing Components of Structures
66 Affecting Backtracking
67 Constructing Compound Goals
68 Equality
69 Input and Output
610 Handling Files
611 Evaluating Arithmetic Expressions
612 Comparing Terms
613 Watching Prolog at Work
More Example Programs
72 Searching a Maze
73 The Towers of Hanoi
74 Parts Inventory
75 List Processing
76 Representing and Manipulating Sets
77 Sorting
78 Using the Database
782 Gensym
783 Findall
79 Searching Graphs
710 Sift the Twos and Sift the Threes
711 Symbolic Differentiation
712 Mapping Structures and Transforming Trees
713 Manipulating Programs
714 Bibliographic Notes
Debugging Prolog Programs
81 Laying out Programs
82 Common Errors
83 The Tracing Model
84 Tracing and Spy Points
841 Examining the Goal
842 Examining the Ancestors
843 Altering the Degree of Tracing
844 Altering the Satisfaction of the Goal
845 Other Options
85 Fixing Bugs
Using Prolog Grammar Rules
92 Representing the Parsing Problem in Prolog
93 The Grammar Rule Notation
94 Adding Extra Arguments
95 Adding Extra Tests
96 Summary
97 Translating Language into Logic
98 More General Use of Grammar Rules
The Relation of Prolog to Logic
102 Clausal Form
103 A Notation for Clauses
104 Resolution and Proving Theorems
105 Horn Clauses
106 Prolog
107 Prolog and Logic Programming
Projects in Prolog
112 Advanced Projects
Answers to Selected Exercises
Clausal Form Program Listings
Writing Portable Standard Prolog Programs
C2 Different Prolog Implementations
C3 Issues to Look Out For
C4 Definitions of some Standard Predicates
C41 Character Processing
C42 Directives
C43 Stream InputOutput
C44 Miscellaneous
Code to Support DCGs
D1 DCG Support Code
Index