Authors’ manuscript 693 ppid September 9, 1995 Prolog Programming in Depth
3
4.11 More About Recursive Loops
: : : : : : : : : : : : : : : : : : : : : :
104
4.12 Organizing Recursive Code
: : : : : : : : : : : : : : : : : : : : : : :
107
4.13 Why Tail Recursion is Special
: : : : : : : : : : : : : : : : : : : : : :
108
4.14 Indexing
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
111
4.15 Modularity, Name Conflicts, and Stubs
: : : : : : : : : : : : : : : : :
113
4.16 How to Document Prolog Predicates
: : : : : : : : : : : : : : : : : :
114
4.17 Supplement: Some Hand Computations
: : : : : : : : : : : : : : : :
116
4.17.1 Recursion
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
116
4.17.2 Saving backtrack points
: : : : : : : : : : : : : : : : : : : : : :
117
4.17.3 Backtracking
: : : : : : : : : : : : : : : : : : : : : : : : : : : :
118
4.17.4 Cuts
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
120
4.17.5 An unexpected loop
: : : : : : : : : : : : : : : : : : : : : : : :
122
4.18 Bibliographical Notes
: : : : : : : : : : : : : : : : : : : : : : : : : :
127
5 Reading Data in Foreign Formats 129
5.1 The Problem of Free–Form Input
: : : : : : : : : : : : : : : : : : : :
129
5.2 Converting Strings to Atoms and Numbers
: : : : : : : : : : : : : :
129
5.3 Combining Our Code with Yours
: : : : : : : : : : : : : : : : : : : :
133
5.4 Validating User Input
: : : : : : : : : : : : : : : : : : : : : : : : : :
134
5.5 Constructing Menus
: : : : : : : : : : : : : : : : : : : : : : : : : : :
135
5.6 Reading Files with
get byte
: : : : : : : : : : : : : : : : : : : : : : :
136
5.7 File Handles (Stream Identifiers)
: : : : : : : : : : : : : : : : : : : :
139
5.8 Fixed–Length Fields
: : : : : : : : : : : : : : : : : : : : : : : : : : :
140
5.9 Now What Do You Do With the Data?
: : : : : : : : : : : : : : : : :
143
5.10 Comma–Delimited Fields
: : : : : : : : : : : : : : : : : : : : : : : :
143
5.11 Binary Numbers
: : : : : : : : : : : : : : : : : : : : : : : : : : : : :
144
5.12 Grand Finale: Reading a Lotus Spreadsheet
: : : : : : : : : : : : : : :
148
5.13 Language and Metalanguage
: : : : : : : : : : : : : : : : : : : : : :
153
5.14 Collecting Alternative Solutions into a List
: : : : : : : : : : : : : : :
153
5.15 Using
bagof
and
setof
: : : : : : : : : : : : : : : : : : : : : : : : :
155
5.16 Finding the Smallest, Largest, or “Best” Solution
: : : : : : : : : : :
157
5.17 Intensional and Extensional Queries
: : : : : : : : : : : : : : : : : :
159
5.18 Operator Definitions
: : : : : : : : : : : : : : : : : : : : : : : : : : :
160
5.19 Giving Meaning to Operators
: : : : : : : : : : : : : : : : : : : : : :
163
5.20 Prolog in Prolog
: : : : : : : : : : : : : : : : : : : : : : : : : : : : :
165
5.21 Extending the Inference Engine
: : : : : : : : : : : : : : : : : : : : :
167
5.22 Personalizing the User Interface
: : : : : : : : : : : : : : : : : : : : :
170
5.23 Bibliographical Notes
: : : : : : : : : : : : : : : : : : : : : : : : : :
172
7 Advanced Techniques 173
7.1 Structures as Trees
: : : : : : : : : : : : : : : : : : : : : : : : : : : :
173
7.2 Lists as Structures
: : : : : : : : : : : : : : : : : : : : : : : : : : : :
175
7.3 How to Search or Process Any Structure
: : : : : : : : : : : : : : : :
176
7.4 Internal Representation of Data
: : : : : : : : : : : : : : : : : : : : :
177
7.5 Simulating Arrays in Prolog
: : : : : : : : : : : : : : : : : : : : : : :
181
7.6 Difference Lists
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
182
7.7 Quicksort
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
183
评论0
最新资源