Download for FREE in 4 easy steps...
This is a Premium eBook - get it free for 30 days
You can also read this in Bookboon.com Premium
The book refers to three different Prolog source files.
300+ Business books exclusively in our Premium eReader
- No adverts
- Advanced features
- Personal library
Users who viewed this item also viewed
Artificial Intelligence: Exercises I - Agents and Environments
Artificial Intelligence: Exercises II - Agent Behaviour I
Artificial Intelligence – Agents and Environments
Artificial Intelligence – Agent Behaviour
Understanding Computer Simulation
Visual Event Computing
Mathematics for Computer Scientists
About the book
The book refers to three different Prolog source files.
This book is the second volume by the author on Prolog programming and its applications written for Ventus. Whereas in the first book , specific Prolog programming techniques were explained, in this volume we discuss some areas where Prolog can be fruitfully employed.
Both books owe their existence to the recognition that the higher educational system (in the UK) does not offer enough opportunities for students to experience the satisfaction associated with successfully completing a technical task. In the writer’s opinion, the learning experience of today’s average student is dominated too much by assessments.
The book comprises four chapters, the first three of them are devoted to Prolog in Artificial Intelligence (AI). The last one is on text processing using Prolog with LATEX in mind.
The first chapter solves an intriguing AI puzzle which was first published in the New Scientist magazine  in 2003. The Prolog solution presented here combines problem specific knowledge using Finite Mathematics with the well-know AI technique ‘generate-and-test’. Even though this chapter did not emanate from my teaching activities, the presentation follows a well-tested pattern: the problem is broken down into manageable and identifiable subproblems which then are more or less readily implemented in Prolog. Many interesting hurdles are identified and solved thereby. The availability of unification as a pattern matching tool makes Prolog uniquely suitable for solving such problems. This first chapter is an adaptation of work reported in . Further recent developments on solving this problem can be found in .
The second and third chapters are respectively devoted to blind search and informed search. The material presented in them can be used in lectures to teach Prolog for AI as well as in AI lectures themselves. I have tried to compile a varied and interesting mixture of applications most of which won’t be available anywhere else. Some of the problems considered here served over the years in my lectures as coursework material, though, for various reasons, the discussion is more thorough here.
The fourth chapter is the least conventional one for a Prolog book. It is in two parts.
1. A tool is developed in Prolog for manipulating LATEX files.
2. Prolog is used to generate LATEX commands for drawing parametric curves in documents written in LATEX.
I also explain here how an SWI-Prolog program can be embedded into a Linux shell script, removing thereby the need for the user to deal with Prolog directly. This results in applications of direct practical interest.
For the maximum benefit (and fun) readers should work through parts of this book interactively with SWI-Prolog. I have tried to retain the experimental and exploratory style of the first volume  even though sometimes digression to more theoretical topics was unavoidable.
There are 54 exercises in this book, 32 of them are solved in Appendix A. The last chapter is somewhat of an exception since there the exercises themselves are the main vehicle for conveying the subject material. Therefore, detailed sample solutions are provided for 6 of the 7 exercises in that chapter.
The associated software (Prolog sorces, Linux shell scripts, data files) listed in Appendix B is freely available from the Ventus website. All three systems used here (Linux, SWI-Prolog, LATEX) are freely available on the Internet.
1. Enigma 1225: Rows are Columns
1.1 A Puzzle
1.2 First Thoughts
1.3 Symbolic Solutions
1.4 Implementation Details
1.4.1 Design Decisions
1.4.2 Admissible Permutations
1.4.3 Generating SymbolicMatrices
1.4.4 Permuting Rows
1.4.6 MostGeneral Patterned SymbolicMatrices
1.4.7 Distinct Rows
1.4.8 Evaluating Patterns
1.4.9 Computing Totals
1.4.10 Complete Implementation
1.5 Enhanced Implementation
1.5.1 What isWrong with the Present Implementation?
1.5.2 Some Results fromthe Theory of Permutations
1.5.3 Generating Representative Permutations
1.5.4 Finishing Touches
2. Blind Search
2.1 Digression on theModule System in Prolog
2.2 Basic Search Problem
2.3 Depth First Search
2.3.1 Naive Solution
2.3.2 Incremental Development Using an Agenda
2.4 Breadth First Search
2.5 Bounded Depth First Search
2.6 Iterative Deepening
2.7 The Module blindsearches
2.8 Application: A Loop Puzzle
2.8.1 The Puzzle
2.8.2 A ‘Hand-Knit’ Solution
2.8.3 Project: Automating the Solution Process
2.8.4 Project: Displaying the Board
2.8.5 Complete Implementation
2.8.6 Full Board Coverage
2.8.7 AvoidingMultiple Solutions
2.8.8 Variants of the Loop Puzzle
2.9 Application: The Eight Puzzle
2.9.1 The Puzzle
2.9.2 Prolog Implementation
3.1 The Network Search Problemwith Costs
3.1.2 The A–Algorithm
3.1.3 Iterative Deepening A and its Admissible Version
3.2 Case Study: The Eight Puzzle Revisited
3.2.1 The Heuristics
3.2.2 Prolog Implementation
3.3 Project: Robot Navigation
3.4 Project: The Shortest Route in aMaze
3.4.1 Suggested Implementation Details
3.5 Project: Moving a Knight
4. Text Processing
4.1 Text Removal
4.1.4 Using a Linux Shell Script
4.1.5 Application: RemovingModel Solutions
4.2 Text Generation and Drawing with LATEX
A. Solutions of Selected Exercises
A.1 Chapter 1 Exercises
A.2 Chapter 2 Exercises
A.3 Chapter 3 Exercises
A.4 Chapter 4 Exercises
Errata to Volume 1
About the Author
The embed frame is free to use for private persons, universities and schools. It is not allowed to be used by any company for commercial purposes unless it is for media coverage. You may not modify, build upon, or block any portion or functionality of the embed frame, including but not limited to links back to the bookboon.com website.
The Embed frame may not be used as part of a commercial business offering. The embed frame is intended for private people who want to share eBooks on their website or blog, professors or teaching professionals who want to make an eBook available directly on their page, and media, journalists or bloggers who wants to discuss a given eBook
If you are in doubt about whether you can implement the embed frame, you are welcome to contact Thomas Buus Madsen on email@example.com and seek permission.