| |
| |
| |
Tutorial Introduction | |
| |
| |
| |
Prolog | |
| |
| |
| |
Objects and Relationships | |
| |
| |
| |
Programming | |
| |
| |
| |
Facts | |
| |
| |
| |
Questions | |
| |
| |
| |
Variables | |
| |
| |
| |
Conjunctions | |
| |
| |
| |
Rules | |
| |
| |
| |
Summary and Exercises | |
| |
| |
| |
A Closer Look | |
| |
| |
| |
Syntax | |
| |
| |
| |
Constants | |
| |
| |
| |
Variables | |
| |
| |
| |
Structures | |
| |
| |
| |
Characters | |
| |
| |
| |
Operators | |
| |
| |
| |
Equality and Unification | |
| |
| |
| |
Arithmetic | |
| |
| |
| |
Summary of Satisfying Goals | |
| |
| |
| |
Successful satisfaction of a conjunction of goals | |
| |
| |
| |
Consideration of goals in backtracking | |
| |
| |
| |
Unification | |
| |
| |
| |
Using Data Structures | |
| |
| |
| |
Structures and Trees | |
| |
| |
| |
Lists | |
| |
| |
| |
Recursive Search | |
| |
| |
| |
Mapping | |
| |
| |
| |
Recursive Comparison | |
| |
| |
| |
Joining Structures Together | |
| |
| |
| |
Accumulators | |
| |
| |
| |
Difference Structures | |
| |
| |
| |
Backtracking and the "Cut" | |
| |
| |
| |
Generating Multiple Solutions | |
| |
| |
| |
The "Cut" | |
| |
| |
| |
Common Uses of the Cut | |
| |
| |
| |
Confirming the Choice of a Rule | |
| |
| |
| |
The "cut-fail" Combination | |
| |
| |
| |
Terminating a "generate and test" | |
| |
| |
| |
Problems with the Cut | |
| |
| |
| |
Input and Output | |
| |
| |
| |
Reading and Writing Terms | |
| |
| |
| |
Reading Terms | |
| |
| |
| |
Writing Terms | |
| |
| |
| |
Reading and Writing Characters | |
| |
| |
| |
Reading Characters | |
| |
| |
| |
Writing Characters | |
| |
| |
| |
Reading English Sentences | |
| |
| |
| |
Reading and Writing Files | |
| |
| |
| |
Opening and closing streams | |
| |
| |
| |
Changing the current input and output | |
| |
| |
| |
Consulting | |
| |
| |
| |
Declaring Operators | |
| |
| |
| |
Built-in Predicates | |
| |
| |
| |
Entering New Clauses | |
| |
| |
| |
Success and Failure | |
| |
| |
| |
Classifying Terms | |
| |
| |
| |
Treating Clauses as Terms | |
| |
| |
| |
Constructing and Accessing Components of Structures | |
| |
| |
| |
Affecting Backtracking | |
| |
| |
| |
Constructing Compound Goals | |
| |
| |
| |
Equality | |
| |
| |
| |
Input and Output | |
| |
| |
| |
Handling Files | |
| |
| |
| |
Evaluating Arithmetic Expressions | |
| |
| |
| |
Comparing Terms | |
| |
| |
| |
Watching Prolog at Work | |
| |
| |
| |
More Example Programs | |
| |
| |
| |
A Sorted Tree Dictionary | |
| |
| |
| |
Searching a Maze | |
| |
| |
| |
The Towers of Hanoi | |
| |
| |
| |
Parts Inventory | |
| |
| |
| |
List Processing | |
| |
| |
| |
Representing and Manipulating Sets | |
| |
| |
| |
Sorting | |
| |
| |
| |
Using the Database | |
| |
| |
| |
Random | |
| |
| |
| |
Gensym | |
| |
| |
| |
Findall | |
| |
| |
| |
Searching Graphs | |
| |
| |
| |
Sift the Two's and Sift the Three's | |
| |
| |
| |
Symbolic Differentiation | |
| |
| |
| |
Mapping Structures and Transforming Trees | |
| |
| |
| |
Manipulating Programs | |
| |
| |
| |
Bibliographic Notes | |
| |
| |
| |
Debugging Prolog Programs | |
| |
| |
| |
Laying out Programs | |
| |
| |
| |
Common Errors | |
| |
| |
| |
The Tracing Model | |
| |
| |
| |
Tracing and Spy Points | |
| |
| |
| |
Examining the Goal | |
| |
| |
| |
Examining the Ancestors | |
| |
| |
| |
Altering the Degree of Tracing | |
| |
| |
| |
Altering the Satisfaction of the Goal | |
| |
| |
| |
Other Options | |
| |
| |
| |
Summary | |
| |
| |
| |
Fixing Bugs | |
| |
| |
| |
Using Prolog Grammar Rules | |
| |
| |
| |
The Parsing Problem | |
| |
| |
| |
Representing the Parsing Problem in Prolog | |
| |
| |
| |
The Grammar Rule Notation | |
| |
| |
| |
Adding Extra Arguments | |
| |
| |
| |
Adding Extra Tests | |
| |
| |
| |
Summary | |
| |
| |
| |
Translating Language into Logic | |
| |
| |
| |
More General Use of Grammar Rules | |
| |
| |
| |
The Relation of Prolog to Logic | |
| |
| |
| |
Brief Introduction to Predicate Calculus | |
| |
| |
| |
Clausal Form | |
| |
| |
| |
A Notation for Clauses | |
| |
| |
| |
Resolution and Proving Theorems | |
| |
| |
| |
Horn Clauses | |
| |
| |
| |
Prolog | |
| |
| |
| |
Prolog and Logic Programming | |
| |
| |
| |
Projects in Prolog | |
| |
| |
| |
Easier Projects | |
| |
| |
| |
Advanced Projects | |
| |
| |
| |
Answers to Selected Exercises | |
| |
| |
| |
Clausal Form Program Listings | |
| |
| |
| |
Writing Portable Standard Prolog Programs | |
| |
| |
| |
Standard Prolog for Portability | |
| |
| |
| |
Different Prolog Implementations | |
| |
| |
| |
Issues to Look Out For | |
| |
| |
| |
Definitions of some Standard Predicates | |
| |
| |
| |
Character Processing | |
| |
| |
| |
Directives | |
| |
| |
| |
Stream Input/Output | |
| |
| |
| |
Miscellaneous | |
| |
| |
| |
Code to Support DCGs | |
| |
| |
| |
DCG Support Code | |
| |
| |
Index | |