Jump to ContentJump to Main Navigation
Thinking as ComputationA First Course$
Users without a subscription are not able to see the full content.

Hector J. Levesque

Print publication date: 2012

Print ISBN-13: 9780262016995

Published to University Press Scholarship Online: August 2013

DOI: 10.7551/mitpress/9780262016995.001.0001

Show Summary Details
Page of
date: 14 October 2019

Writing Prolog Programs

Writing Prolog Programs

Chapter:
(p.63) 4 Writing Prolog Programs
Source:
Thinking as Computation
Author(s):

J. Levesque Hector

Publisher:
The MIT Press
DOI:10.7551/mitpress/9780262016995.003.0004

This chapter discusses how to write the sorts of Prolog programs that will be used in the rest of the book. Section 1 examines what it means for a program to be fully correct. Section 4.2 introduces a new program in a blocks world and studies how it was written. This leads to a discussion of recursion in Section 4.3, and to its companion, mathematical induction, in Section 4.4. Section 4.5 considers the issue of programs that run forever and how to avoid writing them. Section 4.6 looks at a more complex predicate as it appears in the blocks-world program. Finally, Section 4.7 introduces the issue of program efficiency.

Keywords:   computer programming, Prolog programs, blocks world, recursion, mathematical induction, predicate, program efficiency

University Press Scholarship Online requires a subscription or purchase to access the full text of books within the service. Public users can however freely search the site and view the abstracts and keywords for each book and chapter.

Please, subscribe or login to access full text content.

If you think you should have access to this title, please contact your librarian.

To troubleshoot, please check our FAQs, and if you can't find the answer there, please contact us .