The First 10 Prolog Programming Contests

This book shows solutions to problems that were in the first 10 Prolog Programming Contests from 1994 to 2004. Some basic Prolog programming skills are required.

**Tag(s):**
Logic Programming

**Publication date**: 01 Sep 2005

**ISBN-10**:
9090197826

**ISBN-13**:
n/a

**Paperback**:
n/a

**Views**: 14,666

**Type**: N/A

**Publisher**:
n/a

**License**:
n/a

**Post time**: 01 Oct 2007 05:55:20

The First 10 Prolog Programming Contests

This book shows solutions to problems that were in the first 10 Prolog Programming Contests from 1994 to 2004. Some basic Prolog programming skills are required.

:santagrin: This book was suggested by Remko TronĂ§on.

Terms and Conditions:

Excerpts from the Preface:

Prolog is an excellent programming contest language: Prolog is close enough to the ultimate specification language (logic), so that the distance between problem and solution is not too big. This means that, even if you don't have a clue about a good algorithm, you might still end up with a nice program that computes a useful result (at least for small problem sizes). Prolog is also a real programming language, which means you can express your favorite nifty optimal solution strategy in it.

This book shows solutions to problems that were in the first 10 Prolog Programming Contests. The solutions in this book were not constructed by participants during the contest, since the contest rules always prevented that. However, many of our solutions could have been constructed during the contest under extreme time pressure, and so you will find many solutions using the generate and test strategy, together with a higher than usual deployment of member/2, append/3, findall/3 and even reverse/2. On the other hand, we have avoided dynamic predicates (except in the solution of two problems), and we have often preferred the Prolog if-then-else and once/1 predicate over the use of the !. We have also avoided comments in the programs.

Mind you: this book does not attempt to teach you how to program in Prolog. For that, you will need to read one of the excellent books on Prolog, or go through one of the on-line Prolog tutorials. You can find them in the comp.lang.prolog FAQ. Keep in mind that reading the books is not enough: you must do lots of exercises!

So we assume that you have already some basic Prolog programming skills. Then, how should you use this book? We suggest that you do not try to digest all questions and answers at once. Read one problem statement, skip the hints, and solve the problem, preferably with the clock ticking at your side. Oh well, if you really want, you can read the hints anyway. When you are finished programming, look at our solution, and compare it with yours. You might be inclined to make a judgement like 'My solution is better than yours', or the other way around. Don't just stop there: learn from the differences.

Terms and Conditions:

Bart Demoen wrote:The contents of this book are meant to be reproduced in every possible form and without further permission of the authors, as long as no profit is made.

Excerpts from the Preface:

Prolog is an excellent programming contest language: Prolog is close enough to the ultimate specification language (logic), so that the distance between problem and solution is not too big. This means that, even if you don't have a clue about a good algorithm, you might still end up with a nice program that computes a useful result (at least for small problem sizes). Prolog is also a real programming language, which means you can express your favorite nifty optimal solution strategy in it.

This book shows solutions to problems that were in the first 10 Prolog Programming Contests. The solutions in this book were not constructed by participants during the contest, since the contest rules always prevented that. However, many of our solutions could have been constructed during the contest under extreme time pressure, and so you will find many solutions using the generate and test strategy, together with a higher than usual deployment of member/2, append/3, findall/3 and even reverse/2. On the other hand, we have avoided dynamic predicates (except in the solution of two problems), and we have often preferred the Prolog if-then-else and once/1 predicate over the use of the !. We have also avoided comments in the programs.

Mind you: this book does not attempt to teach you how to program in Prolog. For that, you will need to read one of the excellent books on Prolog, or go through one of the on-line Prolog tutorials. You can find them in the comp.lang.prolog FAQ. Keep in mind that reading the books is not enough: you must do lots of exercises!

So we assume that you have already some basic Prolog programming skills. Then, how should you use this book? We suggest that you do not try to digest all questions and answers at once. Read one problem statement, skip the hints, and solve the problem, preferably with the clock ticking at your side. Oh well, if you really want, you can read the hints anyway. When you are finished programming, look at our solution, and compare it with yours. You might be inclined to make a judgement like 'My solution is better than yours', or the other way around. Don't just stop there: learn from the differences.

Tweet

About The Author(s)

No information is available for this author.

No information is available for this author.

No information is available for this author.

No information is available for this author.

Book Categories

Computer Science
Introduction to Computer Science
Introduction to Computer Programming
Algorithms and Data Structures
Artificial Intelligence
Computer Vision
Machine Learning
Neural Networks
Game Development and Multimedia
Data Communication and Networks
Coding Theory
Computer Security
Information Security
Cryptography
Information Theory
Computer Organization and Architecture
Operating Systems
Image Processing
Parallel Computing
Concurrent Programming
Relational Database
Document-oriented Database
Data Mining
Big Data
Data Science
Digital Libraries
Compiler Design and Construction
Functional Programming
Logic Programming
Object Oriented Programming
Formal Methods
Software Engineering
Agile Software Development
Information Systems
Geographic Information System (GIS)

Mathematics
Mathematics
Algebra
Abstract Algebra
Linear Algebra
Number Theory
Numerical Methods
Precalculus
Calculus
Differential Equations
Category Theory
Proofs
Discrete Mathematics
Theory of Computation
Graph Theory
Real Analysis
Complex Analysis
Probability
Statistics
Game Theory
Queueing Theory
Operations Research
Computer Aided Mathematics

Supporting Fields
Web Design and Development
Mobile App Design and Development
System Administration
Cloud Computing
Electric Circuits
Embedded System
Signal Processing
Integration and Automation
Network Science
Project Management

Operating System
Programming/Scripting
Ada
Assembly
C / C++
Common Lisp
Forth
Java
JavaScript
Lua
Microsoft .NET
Rexx
Perl
PHP
Python
R
Rebol
Ruby
Scheme
Tcl/Tk

Miscellaneous
Sponsors