没有合适的资源?快使用搜索试试~ 我知道了~
Concepts, Techniques, and Models of Computer Programming
5星 · 超过95%的资源 需积分: 11 115 下载量 68 浏览量
2008-11-01
11:42:36
上传
评论
收藏 3.43MB PDF 举报
温馨提示
试读
939页
Concepts, Techniques, and Models of Computer Programming
资源推荐
资源详情
资源评论
Concepts, Techniques, and Models
of Computer Programming
PETER VAN ROY
1
Universit´e catholique de Louvain (at Louvain-la-Neuve)
Swedish Institute of Computer Science
SEIF HARIDI
2
Royal Institute of Technology (KTH)
Swedish Institute of Computer Science
June 5, 2003
1
Email: pvr@info.ucl.ac.be,Web: http://www.info.ucl.ac.be/~pvr
2
Email: seif@it.kth.se,Web: http://www.it.kth.se/~seif
ii
Copyright
c
2001-3 by P. Van Roy and S. Haridi. All rights reserved.
Contents
List of Figures xvi
List of Tables xxiv
Preface xxvii
Running the example programs xliii
I Introduction 1
1 Introduction to Programming Concepts 3
1.1 Acalculator.............................. 3
1.2 Variables................................ 4
1.3 Functions ............................... 4
1.4 Lists .................................. 6
1.5 Functionsoverlists .......................... 9
1.6 Correctness .............................. 11
1.7 Complexity .............................. 12
1.8 Lazyevaluation............................ 13
1.9 Higher-orderprogramming...................... 15
1.10Concurrency.............................. 16
1.11Dataflow................................ 17
1.12State.................................. 18
1.13Objects ................................ 19
1.14Classes................................. 20
1.15Nondeterminismandtime ...................... 21
1.16Atomicity ............................... 23
1.17Wheredowegofromhere ...................... 24
1.18Exercises................................ 24
II General Computation Models 29
2 Declarative Computation Model 31
Copyright
c
2001-3 by P. Van Roy and S. Haridi. All rights reserved.
iv CONTENTS
2.1 Definingpracticalprogramminglanguages ............. 33
2.1.1 Languagesyntax ....................... 33
2.1.2 Languagesemantics...................... 38
2.2 Thesingle-assignmentstore ..................... 44
2.2.1 Declarativevariables ..................... 44
2.2.2 Valuestore .......................... 44
2.2.3 Valuecreation......................... 45
2.2.4 Variableidentifiers ...................... 46
2.2.5 Valuecreationwithidentifiers................ 47
2.2.6 Partialvalues ......................... 47
2.2.7 Variable-variablebinding................... 48
2.2.8 Dataflowvariables ...................... 49
2.3 Kernellanguage............................ 50
2.3.1 Syntax............................. 50
2.3.2 Valuesandtypes ....................... 51
2.3.3 Basictypes .......................... 53
2.3.4 Recordsandprocedures ................... 54
2.3.5 Basicoperations ....................... 56
2.4 Kernellanguagesemantics ...................... 57
2.4.1 Basicconcepts......................... 57
2.4.2 Theabstractmachine..................... 61
2.4.3 Non-suspendablestatements................. 64
2.4.4 Suspendablestatements ................... 67
2.4.5 Basicconceptsrevisited ................... 69
2.4.6 Lastcalloptimization .................... 74
2.4.7 Activememoryandmemorymanagement ......... 75
2.5 Fromkernellanguagetopracticallanguage............. 80
2.5.1 Syntacticconveniences .................... 80
2.5.2 Functions (the
fun statement)................ 85
2.5.3 Interactive interface (the
declare statement) ....... 88
2.6 Exceptions............................... 91
2.6.1 Motivationandbasicconcepts................ 91
2.6.2 Thedeclarativemodelwithexceptions ........... 93
2.6.3 Fullsyntax .......................... 95
2.6.4 Systemexceptions ...................... 97
2.7 Advancedtopics............................ 98
2.7.1 Functionalprogramminglanguages ............. 98
2.7.2 Unificationandentailment.................. 100
2.7.3 Dynamicandstatictyping.................. 106
2.8 Exercises................................ 108
Copyright
c
2001-3 by P. Van Roy and S. Haridi. All rights reserved.
CONTENTS v
3 Declarative Programming Techniques 113
3.1 Whatisdeclarativeness? ....................... 117
3.1.1 Aclassificationofdeclarativeprogramming......... 117
3.1.2 Specificationlanguages.................... 119
3.1.3 Implementing components in the declarative model . . . . 119
3.2 Iterativecomputation......................... 120
3.2.1 Ageneralschema....................... 120
3.2.2 Iterationwithnumbers.................... 122
3.2.3 Usinglocalprocedures .................... 122
3.2.4 Fromgeneralschematocontrolabstraction ........ 125
3.3 Recursivecomputation........................ 126
3.3.1 Growingstacksize ...................... 127
3.3.2 Substitution-based abstract machine ............ 128
3.3.3 Converting a recursive to an iterative computation . . . . 129
3.4 Programmingwithrecursion..................... 130
3.4.1 Typenotation......................... 131
3.4.2 Programmingwithlists.................... 132
3.4.3 Accumulators ......................... 142
3.4.4 Differencelists ........................ 144
3.4.5 Queues............................. 149
3.4.6 Trees.............................. 153
3.4.7 Drawingtrees......................... 161
3.4.8 Parsing ............................ 163
3.5 Timeandspaceefficiency ...................... 169
3.5.1 Executiontime ........................ 169
3.5.2 Memoryusage......................... 175
3.5.3 Amortizedcomplexity .................... 177
3.5.4 Reflectionsonperformance.................. 178
3.6 Higher-orderprogramming...................... 180
3.6.1 Basicoperations ....................... 180
3.6.2 Loopabstractions....................... 186
3.6.3 Linguisticsupportforloops ................. 190
3.6.4 Data-driventechniques.................... 193
3.6.5 Explicitlazyevaluation.................... 196
3.6.6 Currying............................ 196
3.7 Abstractdatatypes.......................... 197
3.7.1 Adeclarativestack ...................... 198
3.7.2 Adeclarativedictionary ................... 199
3.7.3 Awordfrequencyapplication ................ 201
3.7.4 Secureabstractdatatypes.................. 204
3.7.5 Thedeclarativemodelwithsecuretypes .......... 205
3.7.6 Asecuredeclarativedictionary ............... 210
3.7.7 Capabilities and security ................... 210
3.8 Nondeclarativeneeds......................... 213
Copyright
c
2001-3 by P. Van Roy and S. Haridi. All rights reserved.
剩余938页未读,继续阅读
资源评论
- FlySkyH2014-07-08相当牛的书,软件工程师读了能学到很多。
dangzhiming
- 粉丝: 11
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- web学习笔记.doc
- 基于pytorch+Unet进行MRI肝脏图像分割源码+数据集+模型.zip
- 在Android Studio中开发一个Android App项目步骤
- 基于yolov8实现进行物体跟踪源码.zip
- Java多线程学习Java多线程学习Java多线程学习Java多线程学习.txt
- 算法数据结构-动态规划算法(Dynamic Programming)超详细总结加应用案例讲解.txt
- 2024最强秋招八股文(精简、纯手打)2024最强秋招八股文(精简、纯手打).txt
- 基于tensorflow多特征融合的微表情识别python源码.zip
- 基于yolov8实现人脸检测的python源码+运行说明.zip
- Micron Memory DDR3 SDRAM 全系列AD集成库(原理图库+PCB封装库).IntLib
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功