Introduction |
|
ix | |
|
|
1 | (12) |
|
|
1 | (2) |
|
|
3 | (5) |
|
1.3 Data Objects in Prolog: Prolog Terms |
|
|
8 | (5) |
|
|
11 | (2) |
|
|
13 | (16) |
|
|
13 | (2) |
|
|
15 | (3) |
|
|
18 | (4) |
|
|
22 | (7) |
|
|
27 | (2) |
|
|
29 | (26) |
|
|
29 | (2) |
|
|
31 | (4) |
|
3.2.1 Unifying Call Terms |
|
|
31 | (4) |
|
|
35 | (4) |
|
|
39 | |
|
3.5 Satisfying Goals: A Summary |
|
|
38 | (12) |
|
3.6 Removing Common Variables |
|
|
50 | (1) |
|
3.7 A Note on Declarative Programming |
|
|
51 | (1) |
|
3.8 Important Note on User-Controlled Backtracking |
|
|
52 | (3) |
|
|
53 | (2) |
|
4 Operators and Arithmetic |
|
|
55 | (14) |
|
|
55 | (3) |
|
|
58 | (3) |
|
|
61 | (3) |
|
|
64 | (1) |
|
4.5 More About Operator Precedence |
|
|
65 | (4) |
|
|
68 | (1) |
|
|
69 | (16) |
|
|
69 | (1) |
|
|
69 | (2) |
|
|
71 | (1) |
|
5.4 Input and Output Using Characters |
|
|
72 | (1) |
|
5.5 Outputting Characters |
|
|
72 | (1) |
|
|
73 | (1) |
|
5.7 Using Characters: Examples |
|
|
74 | (2) |
|
5.8 Input and Output Using Files |
|
|
76 | (1) |
|
5.9 File Output: Changing the Current Output Stream |
|
|
77 | (1) |
|
5.10 File Input: Changing the Current Input Stream |
|
|
77 | (2) |
|
5.10.1 Reading from Files: End of File |
|
|
78 | (1) |
|
5.10.2 Reading from Files: End of Record |
|
|
78 | (1) |
|
5.11 Using Files: Examples |
|
|
79 | (6) |
|
|
81 | (4) |
|
|
85 | (14) |
|
|
85 | (1) |
|
6.2 Looping a Fixed Number of Times |
|
|
85 | (4) |
|
6.3 Looping Until a Condition Is Satisfied |
|
|
89 | (5) |
|
|
89 | (2) |
|
6.3.2 Using the `repeat' Predicate |
|
|
91 | (3) |
|
6.4 Backtracking with Failure |
|
|
94 | (5) |
|
6.4.1 Searching the Prolog Database |
|
|
94 | (2) |
|
6.4.2 Finding Multiple Solutions |
|
|
96 | (1) |
|
|
97 | (2) |
|
7 Preventing Backtracking |
|
|
99 | (10) |
|
|
99 | (1) |
|
|
99 | (6) |
|
|
105 | (4) |
|
|
107 | (2) |
|
8 Changing the Prolog Database |
|
|
109 | (10) |
|
8.1 Changing the Database: Adding and Deleting Clauses |
|
|
109 | (1) |
|
|
110 | (1) |
|
|
111 | (1) |
|
8.4 Changing the Database: Example |
|
|
112 | (2) |
|
8.5 Maintaining a Database of Facts |
|
|
114 | (5) |
|
|
117 | (2) |
|
|
119 | (18) |
|
9.1 Representing Data as Lists |
|
|
119 | (1) |
|
|
120 | (2) |
|
|
122 | (2) |
|
9.4 Built-in Predicate: member |
|
|
124 | (1) |
|
9.5 Built-in Predicate: length |
|
|
125 | (1) |
|
9.6 Built-in Predicate: reverse |
|
|
126 | (1) |
|
9.7 Built-in Predicate: append |
|
|
127 | (1) |
|
9.8 List Processing: Examples |
|
|
128 | (4) |
|
9.9 Using findall/3 to Create a List |
|
|
132 | (5) |
|
|
134 | (3) |
|
|
137 | (10) |
|
10.1 Converting Strings of Characters To and From Lists |
|
|
137 | (1) |
|
|
138 | (1) |
|
|
139 | (2) |
|
10.4 Inputting a String of Characters |
|
|
141 | (1) |
|
|
142 | (2) |
|
10.6 Dividing a String into Its Component Parts |
|
|
144 | (3) |
|
|
146 | (1) |
|
11 More Advanced Features |
|
|
147 | (18) |
|
|
147 | (1) |
|
11.2 Extending Prolog: Arithmetic |
|
|
147 | (6) |
|
11.3 Extending Prolog: Operations on Strings |
|
|
153 | (2) |
|
11.4 Extending Prolog: Sets |
|
|
155 | (2) |
|
|
157 | (8) |
|
|
163 | (2) |
|
12 Using Grammar Rules to Analyse English Sentences |
|
|
165 | (22) |
|
|
165 | (1) |
|
12.2 Parsing English Sentences |
|
|
165 | (16) |
|
12.3 Converting Sentences to List Form |
|
|
181 | (6) |
|
|
186 | (1) |
|
|
187 | (24) |
|
13.1 Implementing an Artificial Language |
|
|
187 | (13) |
|
13.2 Developing an Expert System Shell |
|
|
200 | (11) |
|
|
210 | (1) |
Appendix 1 Built-in Predicates |
|
211 | (6) |
Appendix 2 Built-in Operators |
|
217 | (4) |
Appendix 3 Specimen Solutions to Practical Exercises |
|
221 | (22) |
Appendix 4 Glossary |
|
243 | (8) |
Index |
|
251 | |