Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .

Contents
Preface
What is Prolog?
What are strengths and Weaknesses?
Section 1: Introduction
The Compiler
Horn Clause Logic
Extending the Family Theory
Prolog is a Programming Language
Failing
Backtracking
Improving the Family Theory
Recursion
Side Effects
Conclusion
Section 2: A First Example
Open Visual Prolog
Running a query
Section 4: Facts and Rules
The Rules
The Family Tree Example
Section 5: Operators and Arithmetic
Some Prolog Details
Arity
Spaces
Simple I/O in Prolog
Arithmetic in Prolog
Built-In Predicates
Arithmetic Operators
Some queries:
Exercises
Section 6: Recursion
Using Recursion
Some Examples
Exercise:
The Towers of Hanoi
The Grid Example
Section 7: Structures
The General Form of a Structure
Arithmetic "Functions" and Structures
A simple example of using structures
Section 8: Recursive Structures
Inserting an element
Binary Trees
Exercise
Section 9: Introducing Lists
Format of Lists
Empty and Non-Empty Lists
The length of a list
Summing a list
List Membership
Section 10: Lists as Accumulators
Collecting information
Joining two lists
Reversing a List
Built-In list predicates
Section 11: Backtracking and Cut
Analysing Cases
An Example Of Using The Cut
The First Cut
Another Cut
Yet Another Cut
Section 12: More Control Features
Kinds of cut
Green cuts
Red cuts
Negation as Failure
Warning!
If-then-else in Prolog
The repeat predicate
Section 13: Input and Output
More on I/O
File I/O
Saving and Restoring a Knowledge-Base
Other Approaches to I/O
An Exercise
0 of .
Results for:
P. 1
Tutorial

# Tutorial

Ratings: (0)|Views: 106|Likes:

See more
See less

11/08/2011

pdf

text

original