文件名称:
Springer - Logic Programming With Prolog (2005)
开发工具:
文件大小: 942kb
下载次数: 0
上传时间: 2009-07-21
详细说明: Contents 1. Getting Started 1 1.1 Starting Prolog 1 1.2 Prolog Programs 3 1.3 Data Objects in Prolog: Prolog Terms 8 Practical Exercise 1 12 2. Clauses and Predicates 13 2.1 Clauses 13 2.2 Predicates 15 2.3 Loading Clauses 19 2.4 Variables 21 Practical Exercis e 2 27 3. Satisfying Goals 29 Introduction 29 3.1 Unification 31 3.1.1 Unifying Call Terms 32 3.2 Evaluating Goals 35 3.3 Backtracking 39 3.4 Satisfying Goals: A Summary 50 3.5 Removing Common Variables 52 3.6 A Note on Declarative Programming 52 Practical Exercise 3 55 4. Operators and Arithmetic 57 4.1 Operators 57 4.2 Arithmetic 59 4.3 Equality Operators 63 4.4 Logical Operators 66 Practical Exercise 4 68 xii Contents 5. Input and Output 69 Introduction 69 5.1 Outputting Terms 69 5.2 Inputting Terms 71 5.3 Input and Output Using Characters 72 5.4 Outputting Characters 73 5.5 Inputting Characters 73 5.6 Using Characters: Examples 74 5.7 Input and Output Using Files 77 5.8 File Output: Changing the Current Output Stream 77 5.9 File Input: Changing the Current Input Stream 78 5.9.1 Reading from Files: End of File 78 5.9.2 Reading from Files: End of Record 79 5.10 Using Files: Examples 79 Practical Exercise 5 82 6. Loops 85 Introduction 85 6.1 Looping a Fixed Number of Times 85 6.2 Looping Until a Condition Is Satisfied 89 6.2.1 Recursion 89 6.2.2 Using the 'repeat' Predicate 91 6.3 Backtracking with Failure 94 6.3.1 Searching the Prolog Database 94 6.3.2 Finding Multiple Solutions 96 Practical Exercise 6 97 7. Preventing Backtracking 99 Introduction 99 7.1 The Cut Predicate 99 7.2 Cut with Failure 106 Practical Exercise 7 108 8. Changing the Prolog Database 109 8.1 Changing the Database: Adding and Deleting Clauses 109 8.2 Adding Clauses 110 8.3 Deleting Clauses 111 8.4 Changing the Database: Example 112 8.5 Maintaining a Database of Facts 114 Practical Exercise 8 118 Contents xiii 9. List Processing 119 9.1 Representing Data as Lists 119 9.2 Notation for Lists 120 9.3 Decomposing a List 122 9.4 Built-in Predicate: member 125 9.5 Built-in Predicate: length 126 9.6 Built-in Predicate: reverse 126 9.7 Built-in Predicate: append 127 9.8 List Processing: Examples 129 9.9 Using findall/3 to Create a List 133 Practical Exercise 9 136 10. String Processing 137 10.1 Converting Strings of Characters To and From Lists 137 10.2 Joining Two Strings 139 10.3 Trimming a String 139 10.4 Inputting a String of Characters 141 10.5 Searching a String 142 10.6 Dividing a String into Its Component Parts 144 Practical Exercise 10 147 11. More Advanced Features 149 Introduction 149 11.1 Extending Prolog: Arithmetic 149 11.2 Extending Prolog: Operations on Strings 155 11.3 Extending Prolog: Sets 157 11.4 Processing Terms 160 Practical Exercise 11 166 Appendix 1. Built-in Predicates 167 Appendix 2. Built-in Operators 179 Appendix 3. Specimen Solutions to Practical Exercises 185 Appendix 4. Glossary 209 Index 221 ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.