- Home
- Computers & IT
- Learn Prolog Now!
Learn Prolog Now!
Book Description:
Prolog is a programming language, but a rather unusual one. ``Prolog’’ is short for ``Programming with Logic’’, and the link with logic gives Prolog its special character. At the heart of Prolog lies a surprising idea: don’t tell the computer what to do. Instead, describe situations of interest, and compute by asking questions. Prolog will logically deduce new facts about the situations and give its deductions back to us as answers. Why learn Prolog? For a start, its ``say what the problem is, rather than how to solve it’’ stance, means that it is a very high level language, good for knowledge rich applications such as artificial intelligence, natural language processing, and the semantic web. So by studying Prolog, you gain insight into how sophisticated tasks can be handled computationally. Moreover, Prolog requires a different mindset. You have to learn to see problems from a new perspective, declaratively rather than procedurally. Acquiring this mindset, and learning to appreciate the links between logic and programming, makes the study of Prolog both challenging and rewarding. Learn Prolog Now! is a practical introduction to this fascinating language. Freely available as a web-book since 2002 (see www.learnprolognow.org) Learn Prolog Now! has became one of the most popular introductions to the Prolog programming language, an introduction prized for its clarity and down-to-earth approach. It is widely used as a textbook at university departments around the world, and even more widely used for self study. College Publications is proud to present here the first hard-copy version of this online classic. Carefully revised in the light of reader’s feedback, and now with answers to all the exercises, here you will find the essential material required to help you learn Prolog now.
Table of Contents
* Table of Contents
* 1 Facts, Rules, and Queries
o 1.1 Some simple examples
+ 1.1.1 Knowledge Base 1
+ 1.1.2 Knowledge Base 2
+ 1.1.3 Knowledge Base 3
+ 1.1.4 Knowledge Base 4
+ 1.1.5 Knowledge Base 5
o 1.2 Prolog Syntax
+ 1.2.1 Atoms
+ 1.2.2 Numbers
+ 1.2.3 Variables
+ 1.2.4 Complex terms
o 1.3 Exercises
o 1.4 Practical Session 1
* 2 Matching and Proof Search
o 2.1 Matching
+ 2.1.1 Examples
+ 2.1.2 The occurs check
+ 2.1.3 Programming with matching
o 2.2 Proof Search
o 2.3 Exercises
o 2.4 Practical Session 2
* 3 Recursion
o 3.1 Recursive definitions
+ 3.1.1 Example 1: Eating
+ 3.1.2 Example 2: Descendant
+ 3.1.3 Example 3: Successor
+ 3.1.4 Example 3: Addition
o 3.2 Clause ordering, goal ordering, and termination
o 3.3 Exercises
o 3.4 Practical Session 3
* 4 Lists
o 4.1 Lists
o 4.2 Member
o 4.3 Recursing down lists
o 4.4 Exercises
o 4.5 Practical Session 4
* 5 Arithmetic
o 5.1 Arithmetic in Prolog
o 5.2 A closer look
o 5.3 Arithmetic and lists
o 5.4 Comparing integers
o 5.5 Exercises
o 5.6 Practical Session 5
* 6 More Lists
o 6.1 Append
+ 6.1.1 Defining append
+ 6.1.2 Using append
o 6.2 Reversing a list
+ 6.2.1 Naive reverse using append
+ 6.2.2 Reverse using an accumulator
o 6.3 Exercises
o 6.4 Practical Session 6
* 7 Definite Clause Grammars
o 7.1 Context free grammars
+ 7.1.1 CFG recognition using append
+ 7.1.2 CFG recognition using difference lists
o 7.2 Definite clause grammars
+ 7.2.1 A first example
+ 7.2.2 Adding recursive rules
+ 7.2.3 A DCG for a simple formal language
o 7.3 Exercises
o 7.4 Practical Session 7
* 8 More Definite Clause Grammars
o 8.1 Extra arguments
+ 8.1.1 Context free grammars with features
+ 8.1.2 Building parse trees
+ 8.1.3 Beyond context free languages
o 8.2 Extra goals
+ 8.2.1 Separating rules and lexicon
o 8.3 Concluding remarks
o 8.4 Exercises
o 8.5 Practical Session 8
* 9 A Closer Look at Terms
o 9.1 Comparing terms
o 9.2 Terms with a special notation
+ 9.2.1 Arithmetic terms
+ 9.2.2 Lists as terms
o 9.3 Examining Terms
+ 9.3.1 Types of Terms
+ 9.3.2 The Structure of Terms
o 9.4 Operators
+ 9.4.1 Properties of operators
+ 9.4.2 Defining operators
o 9.5 Exercises
o 9.6 Practical Session
* 10 Cuts and Negation
o 10.1 The cut
o 10.2 If-then-else
o 10.3 Negation as failure
o 10.4 Exercises
o 10.5 Practical Session 10
* 11 Database Manipulation and Collecting Solutions
o 11.1 Database manipulation
o 11.2 Collecting solutions
+ 11.2.1 findall/3
+ 11.2.2 bagof/3
+ 11.2.3 setof/3
o 11.3 Exercises
o 11.4 Practical Session 11
* 12 Working With Files
o 12.1 Splitting Programs Over Files
+ 12.1.1 Reading in Programs
+ 12.1.2 Modules
+ 12.1.3 Libraries
o 12.2 Writing To and Reading From Files
o 12.3 Practical Session
+ 12.3.1 Step 1
+ 12.3.2 Step 2
+ 12.3.3 Step 3
+ 12.3.4 Step 4
+ 12.3.5 Step 5
+ 12.3.6 Step 6
Direct Download Links:
- Read online
- cs.union.edu/~str...l/toc.html#label1
Related Books at ISBNlib
- Prolog Programming for Artificial Intelligence
- Representation and Inference for Natural Language: A First Course in Computational Semantics (Center for the Study of Language and Information - Lecture Notes)
- Programming in Prolog: Using the ISO Standard
- The Haskell Road to Logic, Maths and Programming (Texts in Computing)
- The Craft of Prolog (Logic Programming)

