南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)Separation Logic(1/3)

Separation Logic Acknowledgment:slides taken from Reynolds'mini-course CS 818A3
Separation Logic Acknowledgment: slides taken from Reynolds’ mini-course CS 818A3

Extending Imp with Memory Accesses Syntax: (comm)c::=... |x:=[e I [e]:=e' x cons(e1,e2) I dispose(e) Program States (store)s∈Var→Z (heap)h∈ N-fin Z (state)σ:= (s,h)
Extending Imp with Memory Accesses

Store:x:3,y:4 Heap:empty Allocation x:=cons(1,2); ↓ Store:x:37,y:4 Heap:37:1,38:2 Lookup y:=[x; 业 Store x:37,y:1 Heap:37:1,38:2 Mutation [x+1]:=3; 业 Store: x:37,y:1 Heap 37:1,38:3 Deallocation dispose(x+1) ↓ Store x:37,y:1 Heap:37:1 Note that expressions depend only on the store
Note that expressions depend only on the store

Memory Faults Store:x:3,y:4 Heap:empty Allocation x:cons(1,2); 业 Store x:37,y:4 Heap:37:1,38:2 Lookup y:=[x] 业 Store:x:37,y:1 Heap:37:1,38:2 Mutation [x+2]:=3; 业 abort Faults can also be caused by out-of-range lookup or dealloca- tion

Operational Semantics h(Iellintexps)=n (x :[e],(s,h))(skip,(s(x n),h)) lellintexp s dom(h) (x:=[e],(s,h)→abort [ellintexps=e ee dom(h) ([e]:=e',(s,h))(skip,(s,hie Ie'llintexp s))) [ellintexps年dom(h) ([e:=e',(s,h)→abort lle1 llintexps=n1 Ie2llintexps n2 (e,+1]n dom(h)=0 (x:=cons(e1,e2),(s,h))(skip,(s(xe),hie n,+1 n2)))
Operational Semantics

Assertions Standard predicate logic assertions,plus ·emp (empty heap) The heap is empty. ●e→e (singleton heap) The heap contains one cell,at address e with contents e'. ●p1*P2 (separating conjunction) The heap can be split into two disjoint parts such that p1 holds for one part and p2 holds for the other. ·P1-*P2 (separating implication) If the heap is extended with a disjoint part in which p1 holds, then p2 holds for the extended heap
Assertions Standard predicate logic assertions, plus

Some Abbreviations e、 def a.e where a'not free in e ee der ee*true def e→e1,..,ene→e1*.·*e+n-1→en def e→e1,.·,em dere一e1*…*e十n-1一en ife一e1,.,en*true

Examples of Separating Conjunction 1.x3,y asserts that x points to an adjacent 3 pair of cells containing 3 and y. y 2.y→3,x asserts that y points to an adjacent y pair of cells containing 3 and x. 3.x一3,y*y一3,x asserts that situations (1)and(2)hold for separate parts of the heap

4.x一3,y∧y→3,x asserts that situations (1)and(2)hold for the same heap,which can only happen if the values of x and y are the same. 5.x一3,y∧y→3,x asserts that either (3)or (4)may hold,and that the heap may contain additional cells

An Example of Separating Implication Suppose p holds for Rest Store:x:a,..· 3 of Heap:a:3,a+1:4,. 4 Heap Then (x3,4)-*p holds for Rest Store x:a,.. X一→ of Heap:.· Heap and x1,2 ((x3,4)-*p)holds for Rest Store:x:a,.. of Heap:a:1,a+1:2,.. Heap
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)07_Axiomatic Semantics and Hoare Logic.pdf
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)06_Denotational Semantics.pdf
- 《程序设计语言的形式语义》课程教学资源(文献资料)Lecture Notes on the Lambda Calculus.pdf
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)05_Operational Semantics.pdf
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)04_Lambda Calculus.pptx
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)03_Math.pdf
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)02_CoqOverview.pptx
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)01_Introduction(主讲:冯新宇)Formal Semantics of Programming Languages.ppt
- 私立华联学院:《html5》课程教学资源(课件讲稿)第9章 CSS3高级应用.pdf
- 私立华联学院:《html5》课程教学资源(课件讲稿)第8章 多媒体技术.pdf
- 私立华联学院:《html5》课程教学资源(课件讲稿)第7章 表单的应用.pdf
- 私立华联学院:《html5》课程教学资源(课件讲稿)第6章 浮动与定位.pdf
- 私立华联学院:《html5》课程教学资源(课件讲稿)第5章 CSS盒子模型.pdf
- 私立华联学院:《html5》课程教学资源(课件讲稿)第4章 CSS3选择器.pdf
- 私立华联学院:《html5》课程教学资源(课件讲稿)第3章 CSS3入门.pdf
- 私立华联学院:《html5》课程教学资源(课件讲稿)第2章 HTML5 页面元素及属性.pdf
- 私立华联学院:《html5》课程教学资源(课件讲稿)第1章 初识HTML5.pdf
- 私立华联学院:《html5》课程教学资源(试卷习题)各章习题答案.pdf
- 私立华联学院:《html5》课程教学资源(试卷习题)第9章 CSS3高级应用_习题.pdf
- 私立华联学院:《html5》课程教学资源(试卷习题)第8章 多媒体嵌入_习题.pdf
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)09_Shared-Variable Concurrency.pdf
- 《程序设计语言的形式语义》课程教学资源(文献资料)An Introduction to Separation Logic(Preliminary Draft).pdf
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)Separation Logic(2/3).ppt
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)Separation Logic(3/3).ppt
- 南京大学:《程序设计语言的形式语义》课程教学资源(课件讲稿)10_Simply-Typed Lambda Calculus.pptx
- 私立华联学院:《C语言程序设计》课程教学资源(教案讲义)教学大纲.pdf
- 私立华联学院:《C语言程序设计》课程教学资源(教案讲义)应用案例.pdf
- 私立华联学院:《C语言程序设计》课程教学资源(教案讲义)课程标准(适用专业:物联网应用技术).pdf
- 私立华联学院:《C语言程序设计》课程电子教案(PPT课件)第一章 初识C语言(负责人:周鹏梅).ppt
- 私立华联学院:《C语言程序设计》课程电子教案(PPT课件)第三章 结构化程序设计.ppt
- 私立华联学院:《C语言程序设计》课程电子教案(PPT课件)第二章 数据类型与运算符.ppt
- 私立华联学院:《C语言程序设计》课程电子教案(PPT课件)第七章 结构体和共同体.ppt
- 私立华联学院:《C语言程序设计》课程电子教案(PPT课件)第五章 函数.ppt
- 私立华联学院:《C语言程序设计》课程电子教案(PPT课件)第八章 文件.ppt
- 私立华联学院:《C语言程序设计》课程电子教案(PPT课件)第六章 指针.ppt
- 私立华联学院:《C语言程序设计》课程电子教案(PPT课件)第四章 数组.ppt
- 私立华联学院:《Python语言程序设计》课程教学资源(教案讲义)课程标准(适用专业:软件技术).pdf
- 私立华联学院:《Python语言程序设计》课程教学资源(教案讲义)课程教学设计(负责人:尹菡).pdf
- 《Python语言程序设计》课程教学资源(拓展资源)Python练习实例(Python 100例).pdf
- 《Python语言程序设计》课程教学资源(拓展资源)零基础Python上手编程(2020版).pdf