Prolog

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Welcome to the prolog wikibook. This book can serve as a textbook or tutorial for anyone who wants to learn the prolog programming language. No prior programming experience is required. Some basic knowledge of logic can come in handy. For those new to the subject, a short introduction to logic is given, but this is not required reading.

The first chapters of the book (under basics), describe the main concepts of prolog programming. These chapters are intended to give the reader an understanding of the basic idea behind prolog. The book continues with some more in-depth features of the language, under programming, features that are necessary to prolog programming, but aren't part of the basic structure of prolog. The chapters under basics and programming are meant to be read in order.

The section Built-in predicates deals with the functions available in any prolog compiler. These and other chapters can be read in any order.

A note to readers: Feel free to contribute to the book, especially if you are just starting out on prolog. Just click on edit this page at the top of the page to change the text. If you do not want to contribute directly, any comments you might have will still be greatly appreciated. Just click on discussion at the top of the page to leave comments about the texts (things that were unclear, need further elaboration, etc.), or to ask any question about prolog. In the end, it's the readers that will (hopefully) help set this book apart from the other prolog books out there.

Contents

[edit] Special pages

[edit] Table of contents

[edit] Beginning Prolog

Basics:

Introduction
Rules
Recursive Rules
Lists
Math, Functions and Equality
Putting it Together

Programming:

Cuts and Negation
Reading and Writing code
Difference Lists
Definite Clause Grammars

Built-in Predicates:

Testing Terms
Bagof, Setof and Findall
Modifying the Database
Input and Output
Standard predicates

[edit] In-depth Prolog ideas

Advanced Programming:

Graphics: XPCE
Graphics: SICStus
Graphics: Tk
Error Catching

Data Structures and Algorithms:

[edit] Prolog and beyond

Higher Order Programming
Constraint Logic Programming
Definite Clause Grammars
Combining Languages
Commented Source Code Library

[edit] External Links

External Links

Personal tools
In other languages