Prolog Versus You shows how you can take up the gauntlet of the logic programming language Prolog (PROgramming in LOGic) and use it as an obedient programming and problem solving tool. Logic programming emphasizes that programming is a human activity and consequently that programs should be easy for humans to write, understand and manipulate. In a program knowledge about the problem is stated in a logical language without consideration of the underlying machine language. This book has emerged from undergraduate courses in logic programming. The relation to logic is described and the necessary logic is provided continuously. No previous programming experience is assumed and it can be used by beginners as well as by advanced programmers. The book emphasizes the declarative reading of Prolog programs which greatly facilitates the thinking about the problems and yields programs easy to understand. The book covers logic programs, their execution and data structures; databases and expert systems; program synthesis, program correctness and program transformation as well as an efficient computation of Prolog programs. Each chapter ends with some exercises (with solutions). The book also contains a thorough index, appendices and a chapter on Prolog implementations: DECsystem-10 Prolog, Tricia, Quintus Prolog, MProlog, Turbo Prolog, micro-Prolog and LM-Prolog
Author(s): Anna-Lena Johansson, Agneta Eriksson-Granskog, Anneli Edman
Edition: 1
Publisher: Springer
Year: 1989
Language: English
Pages: 297
City: Berlin, Heidelberg u.a
Cover
Title Page
Copyright Page
Preface
Table of Contents
Round 1. Logic Programs
1.1 World Descriptions
1.2 Clauses
1.2.1 Horn Clauses
1.2.2 Clausal Form
1.3 Definitions
1.3.1 Introduction
1.3.2 Definitions - Programs
1.3.3 Construction of Definitions
1.4 Exercises
Round 2. Execution of Logic Programs
2.1 Horn Clause Proof Procedure 29
2.1.1 Resolution
2.1.2 Unification
2.1.3 Search Space
2.1.4 Proof Trees
2.2 Prolog Proof Procedure
2.2.1 Derivations in Prolog
2.2.2 Proof Trace
2.2.3 Alternative Answers
2.2.4 Incomplete Proof Strategy
2.3 Predefined Relations
2.4 An Example
2.5 Exercises
Round 3. Data Structures
3.1 Constructed Terms
3.2 List Structures
3.3 Tree Structures
3.4 Difference Lists
3.5 Array Structures
3.6 Exercises
Round 4. Databases and Expert Systems
4.1 Metalevels
4.1.1 Open and Closed World
4.1.2 Negation
4.1.3 All Answers
4.2 Databases
4.2.1 Introduction
4.2.2 Data as Relations
4.2.3 Data as Terms
4.3 Expert Systems
4.3.1 Introduction
4.3.2 Prolog for Expert Systems
4.4 An Example
4.5 Exercises
Round 5. Program Methodology
5.1 Derivation of Programs
5.1.1 Specifications - Programs
5.1.2 Natural Deduction
5.1.3 A Programming Calculus
5.2 Proof of Program Properties
5.2.1 Completeness
5.2.2 Termination
5.2.3 Partial Correctness
5.2.4 Other Properties
5.3 Program Transformation
5.4 An Example
5.5 Exercises
Round 6. Efficient Computation
6.1 Search Space Reduction
6.1.1 The Cut Construction
6.1.2 The Cases Construction
6.2 Ordering of Conditions
6.3 Parallelism
6.4 Procedural Interpretation of Logic Programs
6.5 An Example
6.6 Exercises
Round 7. Input and Output
7.1 Input
7.2 Output
7.3 Examples
7.4 Exercises
Round 8. Prolog Implementations
8.1 DECsystem-10 Prolog
8.2 Tricia
8.3 Quintus Prolog
8.4 MProlog
8.5 Turbo Prolog
8.6 micro-Prolog
8.7 LM-Prolog
Round 9. Sparringpartner
9.1 Simple Exercises
9.2 Structures
9.3 Miscellaneous Exercises
9.4 Games
Appendix A. Answers to Exercises
A.l Round 1
A.2 Round 2
A.3 Round 3
A.4 Round 4
A.5 Round 5
A.6 Round 6
A.7 Round 7
Appendix B. Program Traces
B.1 Trace of Sum_of_triads
B.2 Trace of Knights_tour
Appendix C. Transformation Rules
Appendix D. Built-in Predicates
Appendix E. ASCII Codes
Index