CONTENTS
Preface = vii
1 Introduction = 1
1.1 Purpose = 1
1.2 Logic Programming and Language = 1
1.3 Programming In Prolog = 3
1.4 Overview = 4
1.5 Bibliographic Notes = 5
2 Database Prolog = 9
2.1 Databases and Queries = 9
2.2 Extending the Query Language = 11
2.3 The Logic of Prolog = 14
2.4 The Operation of Database Prolog = 18
2.5 Recursive Predicate Definitions = 22
2.6 Problem Sections : Semantic Networks = 26
2.7 Context-Free Grammars = 29
2.8 Problem Section : Grammars = 37
2.9 Bibliographic Notes = 42
3 Pure Prolog = 45
3.1 Prolog Notation Revisited = 45
3.2 Terms and Unification = 46
3.3 Functions in Prolog and Other Languages = 48
3.4 Lists = 52
3.5 The Logic and Operation of Prolog Revisited = 62
3.6 Problem Section : Terms and Lists = 66
3.7 Definite Clause Grammars = 70
3.8 Problem Section : DCGs = 79
3.9 Bibliographic Notes = 87
4 Further Topics in Natural-Language Analysis = 91
4.1 Semantic Interpretation = 91
4.2 Extending the Syntactic Coverage = 114
4.3 Problem Section : Grammar Extensions = 129
4.4 Bibliographic Notes = 134
5 Full Prolog = 137
5.1 Metalogical Facilities = 137
5.2 A Simple Dialogue Program = 149
5.3 User Interaction = 154
5.4 Bibliographic Notes = 157
6 Interpreters = 159
6.1 Prolog in Prolog = 160
6.2 Problem Section : Prolog Interpreters = 165
6.3 Interpreters for DCGs = 167
6.4 Partial Execution and Compilers = 172
6.5 Bottom-Up Parsing = 178
6.6 Tabular Parsing = 185
6.7 Problem Section : DCG Interpreters and Compilers = 207
6.8 Bibliographic Notes = 209
A Listing of Sample Programs = 211
A.1 A Note on Programming Style = 211
A.2 The TALK Program = 212
A.3 The DCG Compiler = 224
Bibliography = 231
Name Index = 245
Subject Index = 249