Flow Interfaces Compositional Abstractions of Concurrent Data Structures. Siddharth Krishna, Dennis Shasha, and Thomas Wies
|
|
- Clifford Clark
- 6 years ago
- Views:
Transcription
1 Flow Interfaces Compositional Abstractions of Concurrent Data Structures Siddharth Krishna, Dennis Shasha, and Thomas Wies
2 Background Verifying programs, separation logic, inductive predicates
3 Verifying Data Structures procedure delete(x: Node) { if (x!= null) { var y := x.next; delete(y); free(x); } } x y null
4 Inductive Predicates ls x x = null emp y. x y ls y ls x y. x y ls y y, z. x y y z ls z y, z, w. y, z, w. y, z, w. x y y z z w ls(w) x y y z z w w = null emp x y y z z null x y z null
5 Proof by SL ls(x) procedure delete(x: Node) { if (x!= null) { var y := x.next; delete(y); free(x); } } emp P C Q P F C Q F ls x x null x y ls(y) x y emp emp
6 Background The Trouble with Inductive Predicates Concurrent data structures are complex
7 Harris' Non-blocking List mh Z Z 8
8 Harris' Non-blocking List mh Z Z fh Z Z
9 Limitations of Inductive Predicates Traversals need to visit each node exactly once. ls mh, null ls fh, null mh fh 2 5 Overlays
10 Limitations of Inductive Predicates Traversals need to visit each node exactly once. harris mh, fh, null... harris( ) mh fh Unbounded sharing
11 Limitations of Inductive Predicates harris mh, fh, null ls(mh, null) mh fh 2 5 Threads can enter main list at arbitrary points
12 Other Approaches Iterated separating conjunction: E G φ(x) mh fh 2 5 Can t do better than closed set of nodes Every node reachable memory leaks
13 Other Approaches Overlapping conjunction: mh fh 2 5 Potentially cyclic complex predicate Updates: ramifications, reason about
14 The Problem An abstraction mechanism that can handle data structures like the Harris list? (i.e. handle overlays, sharing, arbitrary traversals & have easy reasoning)
15 Background The Trouble with Inductive Predicates Flow Interfaces A new abstraction for concurrent data structures
16 The Idea Inductive predicates: Pro: inductive properties Con: fixed traversals Iterated : E G φ(x) Pro: easy reasoning Con: only local properties Best of both? Inductive properties local conditions But allow dependence on inductive quantity: flow
17 Local Data Structure Invariants with Flows root Path counting! Can we express the property that root points to a tree as a local condition of each node in the graph?
18 Flows Step : Define the graph root 0 Graph G = (N, e) N finite set of nodes e: N N D D is a flow domain For example: D = N { } Label each edge in the graph with.
19 Flows Step 2: Calculate the flow root 0 Given an inflow in: N D Here in n = ITE(n =root,, 0) 0 0 0
20 Flows Step 2: Calculate the flow root 0 0 Start with flow(n) = in(n) And iterate until fixpoint flow n = in n + flow n Y e(n Y, n) \Y
21 Flows Step 2: Calculate the flow root 0 0 Different inflows result in different flows
22 Flows Step 3: Define invariant on flow root If every node satisfies the good condition γ^ flow(in, G) n = 0 0 for in n = ITE(n = root,, 0) 0 0 then G is a tree rooted at root
23 Flows Step 3: Define invariant on flow root 0 For lists, enforce at most outgoing edge γ` flow in, G n = (e \ = { n, n Y } e \ = ε) e \ : edge function restricted to nonzero edges leaving n 0
24 Flows Alternate view Flow graph G = (N, E) Viewing E as a matrix, E c \\Y = d E \d E d\y = number of 2-length paths from n to n E ` \\Y = number of l-length paths from n to n Capacity C = I + E + E c + (converges if D is a flow domain) cap G n, n Y C \\Y = the number of paths from n to n flow in, G (n) in n Y cap(g)(n Y, n) \Y
25 Data Invariants 3 root 3 3 Flow domain: ω-cpo & positive semiring (D,,, +,, 0, ) Another Example: lower-bound domain (Z {, },, min, min, max,, ) Label each edge with value of souce node Use in n = ITE(n = root,, ) flow in, G n = max value in some path from root to n These paths are sorted if γ s flow in, G where a is value at n n a
26 Stacking Flows (0, ) root (0, ) (, ) (0, ) (, 5) (, 5) 3 (, ) (, 3) (, 3) 5 7 (,3) (,3) 9 6 (,5) (,5) (0, ) Want shape & data invariants? Flow of product is product of flows! Example: min-heap Use product of path-counting and lowerbound domain Use in n = ITE(n = root, (, ), (0, )) And good condition γ u flow in, G where a is value at n n =, l l a
27 Stacking Flows (, 5) (0, ) (,5) (, 3) (,3) root (, ) (, ) (, 3) (0, ) (0, ) (, 5) (,5) (,3) (0, ) Data invariants are decoupled from shape invariants Min-heap γ u flow in, G Sorted list γ s` flow in, G (e \ = { n, n Y n =, l l a n =, l l a } e \ = ε)
28 Harris List We can now describe Harris List Flow domain: two path-counting flows One from mh and one from fh Every node is on at least one of these lists Nodes labelled: marked/unmarked All nodes in free list are marked mh fh 2 5
29 Expressivity of Flows Flows can describe: Lists (singly and doubly linked, cyclic) Trees (n-ary, arbitrary arity) Nested combinations Sorted lists, binary heaps, BSTs Overlaid structures (threaded and B-link trees) Irregular structures (DAGs, graphs) Unbounded sharing & irregular traversals (Harris) But inductive predicates easier for: Simple inductive structures/abstractions
30 Compositional Reasoning Can we reason compositionally about flows and graphs à la SL?
31 Graph Composition Standard SL Composition (disjoint union) is too weak: r r x * x = x y y y a tree a tree not a tree Need a composition that preserves flow!
32 Flow Graphs Suppose G satisfies γ flow in, G n 2 root
33 Flow Graphs Suppose G satisfies γ flow in, G n 2 and we want to reason about a subgraph G root ? that we modify to G. Is G good? New flow?
34 Flow Graphs (in, G) is a flow graph iff G = (N, N o, e) is a partial graph N - set of internal nodes N o - set of sink nodes e: N x (N N o ) D - edge function in: N D is an inflow 0 0 Inflow in specifies rely of G.
35 Flow Graph Composition (in, G) = (in, G ) (in 2, G 2 ) root in =?, in 2 =? in y n = in n + flow in, G)(n Y e(n Y, n) \ z {
36 Flow Graph Composition (in, G) = (in, G ) (in 2, G 2 ) root in =?, in 2 =? in c n = in n + flow in, G)(n Y e(n Y, n) \ z { ~
37 Flow Graph Composition H H 2 is commutative: H H 2 = H 2 H associative : (H H 2 ) H 3 = H (H 2 H 3 ) cancelative: H H = H H 2 H = H 2 Flow graphs form a separation algebra. We can use them to give semantics to SL assertions. How do we abstract flow graphs?
38 Abstracting Flow Graphs What we want from an abstraction:
39 Modifying the Graph (in, G) = (in, G ) (in 2, G 2 ) (in, G ) (in, G ) (in 2, G 2 ) root Need to preserve the flow into G 2
40 Modifying the Graph (in, G) = (in, G ) (in 2, G 2 ) (in, G ) = (in, G ) (in 2, G 2 ) root Preserve the number of paths going through G?
41 Flow Map of a Flow Graph n n o flm in, G n, n G flm in, G n, n = e n, n y e n, n over all paths in G flow in, G n = in n flm in, G (n, n ) \ {
42 Flow Map: Example
43 Flow Map: Example Flow map abstracts from internal structure of the graph
44 Flow Map: Example Flow map abstracts from internal structure of the graph
45 Flow Map: Example 0 0 Flow map abstracts from internal structure of the graph
46 Flow Interfaces I = (in, a, f) is a flow interface in: N D is an inflow a A is the abstraction of node labels f: N N o D is a flow map u v w ({u 0, v, w }, _, { v, x, v, y, }) x y z
47 Flow Interfaces Flow interfaces induce a congruence on flow graphs: H, H Y I H y H c I H y Y H c Y I Lift flow graph composition to interfaces: (Flow Interfaces, ) also a separation algebra!
48 Reasoning about Modifications congruence can replace G y with any G y Y with same interface u v w u v w x y z x y z Showing equivalence: requires fixpoint reasoning But concurrent algorithms modify small regions
49 Separation Logic with Flow Interfaces Good graph predicate Gr γ (I) γ: SL predicate that defines good node condition and abstraction of heap onto nodes of flow graph I: flow interface Good node predicate N γ (x, I) like Gr but denotes a single node definable in terms of Gr Dirty region predicate [P] γ,i P: SL predicate denotes heap region that is expected to satisfy interface I but may currently not
50 (, 3) root (, ) (,3) (, ) Example Sorted Linked List γ x, in, a, f n k, n Y in n =, l a = {k} l k f = ITE(n Y = null, ε, { n, n Y Global invariant: (, k)}) (, 5) Gr I I \ + 0 = {r, } + 0 I Š = ε (,5)
51 Harris List Global invariant: Φ I. Gr I I \ + 0 = {mh, 0 } + {fh 0, } + 0 I Š = ε
52 Verifying Programs Hoare-style proofs require proving entailments. Example: but ls x, y ls y, z ls(x, z) sls x, y sls y, z sls x, z Solution: add lower and upper bounds sls(x, y, l, u) sls x, y, l, v sls y, z, w, u v w sls(x, z, l, u) Different composition lemma!
53 Data-Structure-Agnostic Lemmas Decomposition Gr I x I I y, I c. N x, I y Gr I c I = I y I c Step I = I y I c x, y I y Š I Š = ε y I c Composition Gr I y Gr I c Gr I y I c
54 Harris: Insert procedure insert() { var l := mh; Φ var r := unmarked(l.next); while (r!= null &&?? ) { l := r; r := unmarked(l.next); } } Gr I mh I \ (Decomp) N l, I` Gr I c I = I` I c Gr I x I I y, I c. N x, I y Gr I c I = I y I c (Decomp)
55 Harris: Insert procedure insert() { } var l := mh; Φ var r := unmarked(l.next); while (r!= null &&?? ) { l := r; r := unmarked(l.next); } N l, I` Gr I c I = I` I c I = I` I c l, r I`Š I Š = ε (Step), (Decomp) N l, I` N r, I Gr I I = I` I I I = I y I c x, y I y Š I Š = ε y I c (Step) Gr I x I I y, I c. N x, I y Gr I c I = I y I c (Decomp)
56 Harris: Insert procedure insert() { } var l := mh; var r := unmarked(l.next); while (r!= null &&?? ) { } l := r; Φ r := unmarked(l.next); N l, I` Gr I c I = I` I c N l, I` N r, I Gr I I = I` I I (Comp) N r, I Gr I I = I I Gr I y Gr I c Gr I y I c (Comp)
57 Harris: Insert procedure insert() { var l := mh; Φ var r := unmarked(l.next); while (r!= null &&?? ) { l := r; r := unmarked(l.next); } } N l, I` Gr I c I = I` I c N l, I` Gr I I = I` I and so on
58 Flow Interfaces Data structure abstractions that can handle unbounded sharing and overlays treat structural and data constraints uniformly do not encode specific traversal strategies provide data-structure-agnostic composition and decomposition rules remain within general theory of separation logic
59 Background The Trouble with Inductive Predicates Flow Interfaces Concurrent Dictionaries A memory-safe, linearizable, abstract template
60 Concurrent Dictionaries Dictionary: key-value store Examples: sorted linked lists, BSTs, B-trees, hash maps, With flows: generic template + proof
61 Inset Flows root 6 {v v < 6} {v v > 6} 3 8 KS: the set of all search keys e.g. KS = Int Inset flow domain: (2,,,,,, KS) {v v < 3} {v v > 3} {v v > 8} 4 9 Label each edge with the set of keys that follow that edge in a search (edgeset).
62 Inset Flows root KS {v v < 6} {v v > 6} KS: the set of all search keys e.g. KS = Int Inset flow domain: (2,,,,,, KS) {v v < 3} {v v > 3} {v v > 8} Set inflow in of root to KS and to for all other nodes.
63 Inset Flows root {v v < 6} KS {v v > 6} I = {v 3 < v} I 2 = {v 3 < v < 6} {v v < 3} {v v > 3} {v v > 8} I 3 = {v 8 < v} I I 2 I 3 flow(in, G)(n) is the inset of node n, i.e., the set of keys k such that a search for k will traverse node n.
64 From Insets to Keysets outset(g) n = ž e(n, n Y ) \ Ÿ v v < 5 v } 5 {5} 7 {v v > 5} keyset(in, G) n = inset(in, G) n outset(g)(n) 3 v < v < 5} keyset(in, G)(n) is the set of keys that could be in n
65 Verifying Concurrent Dictionaries Good state conditions edgesets are disjoint for each n: {e(n,n')} n' N are disjoint keyset of each n covers n's contents: C(G)(n) keyset(in, G)(n) Keyset Theorem [Shasha and Goodman, 988] If all ops preserve good state, and methods search/insert/delete k at node s.t. k keyset(n) The implementation is linearizable
66 Encoding Using Flows Description of good node Description of locked node Contents are in keyset Edgesets leaving node are disjoint Global invariant:
67 Give-up Template
68 Actions
69 Keyset Theorem with Flows Theorem: An implementation of the template with appropriate γ, γ that satisfy the spec below (with some side conditions) is memory safe and linearizable.
70 Background The Trouble with Inductive Predicates Flow Interfaces Concurrent Dictionaries Conclusion A new way to reason about data structures
71 Conclusion Radically new approach for building compositional abstractions of data structures. Fits in existing (concurrent) separation logics. Enables simple correctness proofs of concurrent data structure algorithms. Proofs can abstract from the details of the specific data structure implementation. Siddharth Krishna, Dennis Shasha, and Thomas Wies. Go with the Flow: Compositional Abstractions for Concurrent Data Structures. POPL 208.
72 Dirty Regions Problems with flow graphs as state: Commands need to be local modifying an edge is not Programs may temporarily violate γ Actual programs operate on heaps Solution: State: (heap, flow graph) φ describes region where (heap, graph ) φ and graph I
73 Dirty Regions Commands need to be local Basic commands modify only heap sync(i) updates graph when flow map preserved Programs may temporarily violate γ heap portion can be ahead of graph portion Actual programs operate on heaps γ ties each graph node to its heap representation Graph portion is ghost state
74 Proof by Hand-Waving { x }... null x = null procedure delete(x: Node) { { x } if (x!= null) { x... y null var y := x.next; { x } null delete(y); { } y free(x); } } { } {... } Slides courtesy of Thomas Wies
75 Proof by Hand-Waving { x } null procedure delete(x: Node) { if (x!= null) { var y := x.next; delete(y); free(x); } } { }
76 Separation Logic by Example Points-to predicate x! y x y Stack x 0 y 42 Heap ? A partial heap consisting of one allocated cell
77 Separation Logic by Example Points-to predicate x! y x y Points-to predicate expresses permission to access (i.e. read/write/deallocate) heap location x and nothing else! SL assertions describe the part of the heap that a program is allowed to work with.
78 Separation Logic by Example Points-to predicate y! x x y Stack x 0 y 42 Heap 0? 42 0 A partial heap consisting of one allocated cell
79 Separation Logic by Example Separating conjunction x! y y! x x y Stack x 0 y 42 Heap Composition of disjoint partial heaps
80 Separation Logic by Example Equalities x! y x = z x,z y Stack x 0 y 42 z 0 Heap ? Equalities only constrain the stack
81 Separation Logic by Example Separating conjunction x! y x! z unsatisfiable? Subheaps must be disjoint (x can't be at two different places at once)
82 Separation Logic by Example Classical conjunction x! y y! x x,y?
83 Separation Logic by Example Separating conjunction x! z y! z 2 x = y still unsatisfiable? Convention: has higher precedence than
Flow Interfaces Compositional Abstractions of Concurrent Data Structures. Siddharth Krishna, Dennis Shasha, and Thomas Wies
Flow Interfaces Compositional Abstractions of Concurrent Data Structures Siddharth Krishna, Dennis Shasha, and Thomas Wies Background Verifying programs, separation logic, inductive predicates Slides courtesy
More informationIntroduction to Permission-Based Program Logics Part II Concurrent Programs
Introduction to Permission-Based Program Logics Part II Concurrent Programs Thomas Wies New York University Example: Lock-Coupling List 2 3 5 7 8 9 There is one lock per node; threads acquire locks in
More informationProgram Verification using Separation Logic Lecture 0 : Course Introduction and Assertion Language. Hongseok Yang (Queen Mary, Univ.
Program Verification using Separation Logic Lecture 0 : Course Introduction and Assertion Language Hongseok Yang (Queen Mary, Univ. of London) Dream Automatically verify the memory safety of systems software,
More informationCompositional Entailment Checking for a Fragment of Separation Logic
Compositional Entailment Checking for a Fragment of Separation Logic Constantin Enea 1, Ondřej Lengál 2, Mihaela Sighireanu 1, and Tomáš Vojnar 2 1 Univ. Paris Diderot, LIAFA CNRS UMR 7089 2 FIT, Brno
More informationDesign of Distributed Systems Melinda Tóth, Zoltán Horváth
Design of Distributed Systems Melinda Tóth, Zoltán Horváth Design of Distributed Systems Melinda Tóth, Zoltán Horváth Publication date 2014 Copyright 2014 Melinda Tóth, Zoltán Horváth Supported by TÁMOP-412A/1-11/1-2011-0052
More informationCompositional Entailment Checking for a Fragment of Separation Logic
Compositional Entailment Checking for a Fragment of Separation Logic FIT BUT Technical Report Series Constantin Enea, Ondřej Lengál, Mihaela Sighireanu, and Tomáš Vojnar Technical Report No. FIT-TR-2014-01
More informationSanjit A. Seshia EECS, UC Berkeley
EECS 219C: Computer-Aided Verification Explicit-State Model Checking: Additional Material Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: G. Holzmann Checking if M satisfies : Steps 1. Compute Buchi
More informationSeparation Logic and Graphical Models
Separation Logic and Graphical Models John Wickerson and Tony Hoare Semantics Lunch, 25th October 2010 1 Trace composition Problem: Composition is non-deterministic. 2 Trace composition Problem: Composition
More informationLecturecise 22 Weak monadic second-order theory of one successor (WS1S)
Lecturecise 22 Weak monadic second-order theory of one successor (WS1S) 2013 Reachability in the Heap Many programs manipulate linked data structures (lists, trees). To express many important properties
More informationProgram Verification Using Separation Logic
Program Verification Using Separation Logic Cristiano Calcagno Adapted from material by Dino Distefano Lecture 1 Goal of the course Study Separation Logic having automatic verification in mind Learn how
More informationUniversität Augsburg
Universität Augsburg Algebraic Separation Logic H.-H. Dang P. Höfner B. Möller Report 2010-06 July 2010 Institut für Informatik D-86135 Augsburg Copyright c H.-H. Dang P. Höfner B. Möller Institut für
More informationA Short Introduction to Hoare Logic
A Short Introduction to Hoare Logic Supratik Chakraborty I.I.T. Bombay June 23, 2008 Supratik Chakraborty (I.I.T. Bombay) A Short Introduction to Hoare Logic June 23, 2008 1 / 34 Motivation Assertion checking
More information8 Priority Queues. 8 Priority Queues. Prim s Minimum Spanning Tree Algorithm. Dijkstra s Shortest Path Algorithm
8 Priority Queues 8 Priority Queues A Priority Queue S is a dynamic set data structure that supports the following operations: S. build(x 1,..., x n ): Creates a data-structure that contains just the elements
More informationRelational Parametricity and Separation Logic. Hongseok Yang, Queen Mary, Univ. of London Lars Birkedal, IT Univ. of Copenhagen
Relational Parametricity and Separation Logic Hongseok Yang, Queen Mary, Univ. of London Lars Birkedal, IT Univ. of Copenhagen Challenge Develop a theory of data abstraction for pointer programs. When
More informationVerifying Concurrent Memory Reclamation Algorithms with Grace
Verifying Concurrent Memory Reclamation Algorithms with Grace Alexey Gotsman, Noam Rinetzky, and Hongseok Yang 1 IMDEA Software Institute 2 Tel-Aviv University 3 University of Oxford Abstract. Memory management
More informationViews: Compositional Reasoning for Concurrent Programs
Views: Compositional Reasoning for Concurrent Programs Thomas Dinsdale-Young Imperial College td202@doc.ic.ac.uk Lars Birkedal IT University of Copenhagen birkedal@itu.dk Philippa Gardner Imperial College
More informationExtended Transitive Separation Logic
Extended Transitive Separation Logic H.-H. Dang, B. Möller Institut für Informatik, Universität Augsburg, D-86135 Augsburg, Germany Abstract Separation logic (SL) is an extension of Hoare logic by operators
More informationAutomatic Parallelization with Separation Logic
Automatic Parallelization with Separation Logic Mohammad Raza, Cristiano Calcagno, and Philippa Gardner Department of Computing, Imperial College London 180 Queen s Gate, London SW7 2AZ, UK {mraza,ccris,pg}@doc.ic.ac.uk
More informationChapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.
Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright Pearson-Addison Wesley. All rights reserved. 4 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and finishes
More informationAutomatic Verification of Parameterized Data Structures
Automatic Verification of Parameterized Data Structures Jyotirmoy V. Deshmukh, E. Allen Emerson and Prateek Gupta The University of Texas at Austin The University of Texas at Austin 1 Outline Motivation
More informationCompositional Invariant Checking for Overlaid and Nested Linked Lists
Compositional Invariant Checking for Overlaid and Nested Linked Lists Constantin Enea, Vlad Saveluc, and Mihaela Sighireanu Univ Paris Diderot, Sorbonne Paris Cite, LIAFA CNRS UMR 7089, Paris, {cenea,sighirea}@liafa.univ-paris-diderot.fr
More informationLectures on Separation Logic. Lecture 2: Foundations
Lectures on Separation Logic. Lecture 2: Foundations Peter O Hearn Queen Mary, University of London Marktoberdorf Summer School, 2011 Outline for this lecture Part I : Assertions and Their Semantics Part
More informationSpatial Interpolants
Spatial Interpolants Aws Albargouthi 1, Josh Berdine 2, Byron Cook 3, and Zachary Kincaid 4 University of Wisconsin-Madison 1, Microsoft Research 2, University College London 3, University of Toronto 4
More informationSeparation Logic and the Mashup Isolation Problem
Separation Logic and the Mashup Isolation Problem Dept. of Computer Science, Stanford University Phd Qualifier Exam Talk Outline 1 Background Hoare Logic Intuition behind Separation Logic 2 The Mashup
More informationAutomata-Theoretic Model Checking of Reactive Systems
Automata-Theoretic Model Checking of Reactive Systems Radu Iosif Verimag/CNRS (Grenoble, France) Thanks to Tom Henzinger (IST, Austria), Barbara Jobstmann (CNRS, Grenoble) and Doron Peled (Bar-Ilan University,
More informationChapter 2. Assertions. An Introduction to Separation Logic c 2011 John C. Reynolds February 3, 2011
Chapter 2 An Introduction to Separation Logic c 2011 John C. Reynolds February 3, 2011 Assertions In this chapter, we give a more detailed exposition of the assertions of separation logic: their meaning,
More informationTheories of Programming Languages Assignment 5
Theories of Programming Languages Assignment 5 December 17, 2012 1. Lambda-Calculus (see Fig. 1 for initions of = β, normal order evaluation and eager evaluation). (a) Let Ω = ((λx. x x) (λx. x x)), and
More informationModular Termination Verification for Non-blocking Concurrency
Modular Termination Verification for Non-blocking Concurrency Pedro da Rocha Pinto 1, Thomas Dinsdale-Young 2, Philippa Gardner 1, and Julian Sutherland 1 1 Imperial College London pmd09,pg,jhs110@doc.ic.ac.uk
More informationCS 4407 Algorithms Lecture: Shortest Path Algorithms
CS 440 Algorithms Lecture: Shortest Path Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Outline Shortest Path Problem General Lemmas and Theorems. Algorithms Bellman-Ford
More informationA Pointer Logic for Object Diagrams
UNU-IIST International Institute for Software Technology A Pointer Logic for Object Diagrams Yifeng Chen and J W Sanders July 2007 UNU-IIST Report No. 379 R UNU-IIST and UNU-IIST Reports UNU-IIST (United
More informationSorting. Chapter 11. CSE 2011 Prof. J. Elder Last Updated: :11 AM
Sorting Chapter 11-1 - Sorting Ø We have seen the advantage of sorted data representations for a number of applications q Sparse vectors q Maps q Dictionaries Ø Here we consider the problem of how to efficiently
More informationConcurrency, Rely/Guarantee and Separation Logic
Concurrency, Rely/Guarantee and Separation Logic Cliff Jones Newcastle University Overture Workshop 2014-06-21 Concurrency, Rely/Guarantee and Separation Logic Cliff Jones [1] Expressive power must be
More informationPropositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel
Propositional Logic Testing, Quality Assurance, and Maintenance Winter 2018 Prof. Arie Gurfinkel References Chpater 1 of Logic for Computer Scientists http://www.springerlink.com/content/978-0-8176-4762-9/
More informationPropositional and Predicate Logic - V
Propositional and Predicate Logic - V Petr Gregor KTIML MFF UK WS 2016/2017 Petr Gregor (KTIML MFF UK) Propositional and Predicate Logic - V WS 2016/2017 1 / 21 Formal proof systems Hilbert s calculus
More informationStructuring the verification of heap-manipulating programs
Structuring the verification of heap-manipulating programs Aleksandar Nanevski (IMDEA Madrid) Viktor Vafeiadis (MSR / Univ. of Cambridge) Josh Berdine (MSR Cambridge) Hoare/Separation Logic Hoare logic
More informationCollecting garbage concurrently (but correctly)
Collecting garbage concurrently (but correctly) Kamal Lodaya The Institute of Mathematical Sciences, Chennai Joint work with Kalpesh Kapoor (IIT, Guwahati) and Uday Reddy (U. Birmingham) 1 First order
More informationChapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.
Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and
More informationRecent developments in concurrent program logics
Recent developments in concurrent program logics Viktor Vafeiadis University of Cambridge PSPL 2010 Why program logic? Reasoning framework Capture common reasoning principles Reduce accidental proof complexity
More informationConstraint Solving for Program Verification: Theory and Practice by Example
Constraint Solving for Program Verification: Theory and Practice by Example Andrey Rybalchenko Technische Universität München Abstract. Program verification relies on the construction of auxiliary assertions
More informationChapter 6: Computation Tree Logic
Chapter 6: Computation Tree Logic Prof. Ali Movaghar Verification of Reactive Systems Outline We introduce Computation Tree Logic (CTL), a branching temporal logic for specifying system properties. A comparison
More informationPredicate Abstraction and Refinement for Verifying Multi-Threaded Programs
Predicate Abstraction and Refinement for Verifying Multi-Threaded Programs Ashutosh Gupta Corneliu Popeea Andrey Rybalchenko Institut für Informatik, Technische Universität München Germany {guptaa,popeea,rybal}@in.tum.de
More informationDesign and Analysis of Algorithms
Design and Analysis of Algorithms CSE 5311 Lecture 21 Single-Source Shortest Paths Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 Single-Source
More informationAN INTRODUCTION TO SEPARATION LOGIC. 2. Assertions
AN INTRODUCTION TO SEPARATION LOGIC 2. Assertions John C. Reynolds Carnegie Mellon University January 7, 2011 c 2011 John C. Reynolds Pure Assertions An assertion p is pure iff, for all stores s and all
More informationDynamic Programming on Trees. Example: Independent Set on T = (V, E) rooted at r V.
Dynamic Programming on Trees Example: Independent Set on T = (V, E) rooted at r V. For v V let T v denote the subtree rooted at v. Let f + (v) be the size of a maximum independent set for T v that contains
More informationFunctional Data Structures
Functional Data Structures with Isabelle/HOL Tobias Nipkow Fakultät für Informatik Technische Universität München 2017-2-3 1 Part II Functional Data Structures 2 Chapter 1 Binary Trees 3 1 Binary Trees
More informationTHE AUSTRALIAN NATIONAL UNIVERSITY Second Semester COMP2600/COMP6260 (Formal Methods for Software Engineering)
THE AUSTRALIAN NATIONAL UNIVERSITY Second Semester 2016 COMP2600/COMP6260 (Formal Methods for Software Engineering) Writing Period: 3 hours duration Study Period: 15 minutes duration Permitted Materials:
More informationRelations to first order logic
An Introduction to Description Logic IV Relations to first order logic Marco Cerami Palacký University in Olomouc Department of Computer Science Olomouc, Czech Republic Olomouc, November 6 th 2014 Marco
More informationChapter 4: Computation tree logic
INFOF412 Formal verification of computer systems Chapter 4: Computation tree logic Mickael Randour Formal Methods and Verification group Computer Science Department, ULB March 2017 1 CTL: a specification
More informationMatching Logic: Syntax and Semantics
Matching Logic: Syntax and Semantics Grigore Roșu 1 and Traian Florin Șerbănuță 2 1 University of Illinois at Urbana-Champaign, USA grosu@illinois.edu 2 University of Bucharest, Romania traian.serbanuta@unibuc.ro
More informationAn Entailment Checker for Separation Logic with Inductive Definitions
An Entailment Checker for Separation Loic with Inductive Definitions Radu Iosif, Cristina Serban Université de Grenoble Alpes, CNRS, VERIMAG July 18, 2018 Cristina Serban (VERIMAG) An Entailment Checker
More informationA Decidable Fragment of Separation Logic
A Decidable Fragment of Separation Logic Josh Berdine 1, Cristiano Calcagno 2, and Peter W. O Hearn 1 1 Queen Mary, University of London {berdine,ohearn}@dcs.qmul.ac.uk 2 Imperial College, London ccris@doc.ic.ac.uk
More informationFormal Modeling with Propositional Logic
Formal Modeling with Propositional Logic Assaf Kfoury February 6, 2017 (last modified: September 3, 2018) Contents 1 The Pigeon Hole Principle 2 2 Graph Problems 3 2.1 Paths in Directed Graphs..................................
More informationA PROOF SYSTEM FOR SEPARATION LOGIC WITH MAGIC WAND
A PROOF SYSTEM FOR SEPARATION LOGIC WITH MAGIC WAND WONYEOL LEE, JINEON BAEK, AND SUNGWOO PARK Stanford, USA e-mail address: wonyeol@stanfordedu POSTECH, Republic of Korea e-mail address: gok01172@postechackr
More informationInductive Data Flow Graphs
Inductive Data Flow Graphs Azadeh Farzan University of Toronto Zachary Kincaid Andreas Podelski University of Freiburg Abstract The correctness of a sequential program can be shown by the annotation of
More informationHeaps Induction. Heaps. Heaps. Tirgul 6
Tirgul 6 Induction A binary heap is a nearly complete binary tree stored in an array object In a max heap, the value of each node that of its children (In a min heap, the value of each node that of its
More informationSpace-aware data flow analysis
Space-aware data flow analysis C. Bernardeschi, G. Lettieri, L. Martini, P. Masci Dip. di Ingegneria dell Informazione, Università di Pisa, Via Diotisalvi 2, 56126 Pisa, Italy {cinzia,g.lettieri,luca.martini,paolo.masci}@iet.unipi.it
More informationLogical Characterization of Weighted Pebble Walking Automata
Logical Characterization of Weighted Pebble Walking Automata Benjamin Monmege Université libre de Bruxelles, Belgium Benedikt Bollig and Paul Gastin (LSV, ENS Cachan, France) Marc Zeitoun (LaBRI, Bordeaux
More informationLecture 12 Scribe Notes
6.890: Algorithmic Lower Bounds: Fun With Hardness Proofs Fall 04 Prof. Erik Demaine Lecture Scribe Notes Recap For the past two classes, we ve been covering inapproximability, some of its reduction styles,
More informationA MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ
A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ NICOLAS FORD Abstract. The goal of this paper is to present a proof of the Nullstellensatz using tools from a branch of logic called model theory. In
More informationAbstractions and Decision Procedures for Effective Software Model Checking
Abstractions and Decision Procedures for Effective Software Model Checking Prof. Natasha Sharygina The University of Lugano, Carnegie Mellon University Microsoft Summer School, Moscow, July 2011 Lecture
More informationReview Of Topics. Review: Induction
Review Of Topics Asymptotic notation Solving recurrences Sorting algorithms Insertion sort Merge sort Heap sort Quick sort Counting sort Radix sort Medians/order statistics Randomized algorithm Worst-case
More informationThe Underlying Semantics of Transition Systems
The Underlying Semantics of Transition Systems J. M. Crawford D. M. Goldschlag Technical Report 17 December 1987 Computational Logic Inc. 1717 W. 6th St. Suite 290 Austin, Texas 78703 (512) 322-9951 1
More informationSalembier s Min-tree algorithm turned into breadth first search
Information Processing Letters 88 (2003) 225 229 www.elsevier.com/locate/ipl Salembier s Min-tree algorithm turned into breadth first search Wim H. Hesselink Department of Mathematics and Computing Science,
More informationSearch and Lookahead. Bernhard Nebel, Julien Hué, and Stefan Wölfl. June 4/6, 2012
Search and Lookahead Bernhard Nebel, Julien Hué, and Stefan Wölfl Albert-Ludwigs-Universität Freiburg June 4/6, 2012 Search and Lookahead Enforcing consistency is one way of solving constraint networks:
More informationTute 10. Liam O'Connor. May 23, 2017
Tute 10 Liam O'Connor May 23, 2017 proc Search(value g : G, value s : V g, value k : K, result v : T, result f : B) Where a graph g : G is dened as a 4-tuple (V, Γ, κ, λ) containing a set of vertices V,
More information16. Binary Search Trees. [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap ]
423 16. Binary Search Trees [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap. 12.1-12.3] Dictionary implementation 424 Hashing: implementation of dictionaries with expected very fast access times. Disadvantages
More informationFrom Separation Logic to Systems Software
From Separation Logic to Systems Software Peter O Hearn, Queen Mary Based on work of the SpaceInvader team: Cristiano Calcagno, Dino Distefano, Hongseok Yang, and me Special thanks to our SLAyer colleagues
More informationSemi-Markov/Graph Cuts
Semi-Markov/Graph Cuts Alireza Shafaei University of British Columbia August, 2015 1 / 30 A Quick Review For a general chain-structured UGM we have: n n p(x 1, x 2,..., x n ) φ i (x i ) φ i,i 1 (x i, x
More informationSize-Change Termination and Transition Invariants
Size-Change Termination and Transition Invariants Matthias Heizmann 1, Neil D. Jones 2, and Andreas Podelski 1 1 University of Freiburg, Germany 2 University of Copenhagen, Denmark Abstract. Two directions
More informationCompiling Techniques
Lecture 11: Introduction to 13 November 2015 Table of contents 1 Introduction Overview The Backend The Big Picture 2 Code Shape Overview Introduction Overview The Backend The Big Picture Source code FrontEnd
More information16. Binary Search Trees. [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap ]
418 16. Binary Search Trees [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap. 12.1-12.3] 419 Dictionary implementation Hashing: implementation of dictionaries with expected very fast access times. Disadvantages
More informationSolutions. Prelim 2[Solutions]
Prelim [Solutions]. Short Answer [ pts] (a) [ pts] A traversal of an expression tree produces the string + + 3. i. What kind of traversal is it? Preorder; the operator is printed before the operands. ii.
More informationCS 6110 Lecture 21 The Fixed-Point Theorem 8 March 2013 Lecturer: Andrew Myers. 1 Complete partial orders (CPOs) 2 Least fixed points of functions
CS 6110 Lecture 21 The Fixed-Point Theorem 8 March 2013 Lecturer: Andrew Myers We saw that the semantics of the while command are a fixed point. We also saw that intuitively, the semantics are the limit
More informationApplied Logic for Computer Scientists. Answers to Some Exercises
Applied Logic for Computer Scientists Computational Deduction and Formal Proofs Springer, 2017 doi: http://link.springer.com/book/10.1007%2f978-3-319-51653-0 Answers to Some Exercises Mauricio Ayala-Rincón
More informationReverse mathematics of some topics from algorithmic graph theory
F U N D A M E N T A MATHEMATICAE 157 (1998) Reverse mathematics of some topics from algorithmic graph theory by Peter G. C l o t e (Chestnut Hill, Mass.) and Jeffry L. H i r s t (Boone, N.C.) Abstract.
More informationProgram Analysis and Verification
Program Analysis and Verification 0368-4479 Noam Rinetzky Lecture 4: Axiomatic Semantics Slides credit: Tom Ball, Dawson Engler, Roman Manevich, Erik Poll, Mooly Sagiv, Jean Souyris, Eran Tromer, Avishai
More informationProgram verification. 18 October 2017
Program verification 18 October 2017 Example revisited // assume(n>2); void partition(int a[], int n) { int pivot = a[0]; int lo = 1, hi = n-1; while (lo
More informationImperative Data Parallelism (Correctness)
Imperative Data Parallelism (Correctness) Unit 1.b 1 Acknowledgments Authored by Thomas Ball, MSR Redmond 9/4/2010 2 Concepts Code Concept Parallel.Invoke Parallel.ForEach Correctness Concept Schedules
More informationAxiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements
Axiomatic Semantics: Verification Conditions Meeting 12, CSCI 5535, Spring 2009 Announcements Homework 4 is due tonight Wed forum: papers on automated testing using symbolic execution 2 Questions? Review
More informationSyntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.
First-Order Logic Syntax The alphabet of a first-order language is organised into the following categories. Logical connectives:,,,,, and. Auxiliary symbols:.,,, ( and ). Variables: we assume a countable
More informationCentral Algorithmic Techniques. Iterative Algorithms
Central Algorithmic Techniques Iterative Algorithms Code Representation of an Algorithm class InsertionSortAlgorithm extends SortAlgorithm { void sort(int a[]) throws Exception { for (int i = 1; i < a.length;
More informationBinary Decision Diagrams
Binary Decision Diagrams Literature Some pointers: H.R. Andersen, An Introduction to Binary Decision Diagrams, Lecture notes, Department of Information Technology, IT University of Copenhagen Tools: URL:
More informationClock-driven scheduling
Clock-driven scheduling Also known as static or off-line scheduling Michal Sojka Czech Technical University in Prague, Faculty of Electrical Engineering, Department of Control Engineering November 8, 2017
More informationSpring 2016 Program Analysis and Verification. Lecture 3: Axiomatic Semantics I. Roman Manevich Ben-Gurion University
Spring 2016 Program Analysis and Verification Lecture 3: Axiomatic Semantics I Roman Manevich Ben-Gurion University Warm-up exercises 1. Define program state: 2. Define structural semantics configurations:
More informationA Simple Implementation Technique for Priority Search Queues
A Simple Implementation Technique for Priority Search Queues RALF HINZE Institute of Information and Computing Sciences Utrecht University Email: ralf@cs.uu.nl Homepage: http://www.cs.uu.nl/~ralf/ April,
More informationCS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi
CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs Instructor: Shaddin Dughmi Outline 1 Introduction 2 Shortest Path 3 Algorithms for Single-Source Shortest
More informationTemporal logics and explicit-state model checking. Pierre Wolper Université de Liège
Temporal logics and explicit-state model checking Pierre Wolper Université de Liège 1 Topics to be covered Introducing explicit-state model checking Finite automata on infinite words Temporal Logics and
More informationCTL Model Checking. Wishnu Prasetya.
CTL Model Checking Wishnu Prasetya wishnu@cs.uu.nl www.cs.uu.nl/docs/vakken/pv Background Example: verification of web applications à e.g. to prove existence of a path from page A to page B. Use of CTL
More informationIS 709/809: Computational Methods in IS Research Fall Exam Review
IS 709/809: Computational Methods in IS Research Fall 2017 Exam Review Nirmalya Roy Department of Information Systems University of Maryland Baltimore County www.umbc.edu Exam When: Tuesday (11/28) 7:10pm
More informationAMORTIZED ANALYSIS. binary counter multipop stack dynamic table. Lecture slides by Kevin Wayne. Last updated on 1/24/17 11:31 AM
AMORTIZED ANALYSIS binary counter multipop stack dynamic table Lecture slides by Kevin Wayne http://www.cs.princeton.edu/~wayne/kleinberg-tardos Last updated on 1/24/17 11:31 AM Amortized analysis Worst-case
More informationGlobal Value Numbering using Random Interpretation
Global Value Numbering using Random Interpretation Sumit Gulwani gulwani@cs.berkeley.edu George C. Necula necula@cs.berkeley.edu Department of Electrical Engineering and Computer Science University of
More informationUndirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11
Undirected Graphs Undirected graph. G = (V, E) V = nodes. E = edges between pairs of nodes. Captures pairwise relationship between objects. Graph size parameters: n = V, m = E. V = {, 2, 3,,,, 7, 8 } E
More informationDecidability of Inferring Inductive Invariants
Decidability of Inferring Inductive Invariants Oded Padon Tel Aviv University, Israel odedp@mail.tau.ac.il Neil Immerman University of Massachusetts, Amherst, USA immerman@cs.umass.edu Sharon Shoham The
More informationAbstracting Definitional Interpreters. David Van Horn
Abstracting Definitional Interpreters David Van Horn Abstracting Definitional Interpreters David Van Horn Northeastern University Definitional interpreters written in monadic style can express a wide variety
More informationNested Interpolants. Matthias Heizmann Jochen Hoenicke Andreas Podelski. Abstract. 1. Introduction. University of Freiburg, Germany
c ACM 2010. This is the author s version of the work. t is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in Principles of Programming
More informationConstraint Solving for Program Verification: Theory and Practice by Example
Constraint Solving for Program Verification: Theory and Practice by Example Andrey Rybalchenko Technische Universität München Abstract. Program verification relies on the construction of auxiliary assertions
More informationBiLog: Spatial Logics for Bigraphs 1
BiLog: Spatial Logics for Bigraphs 1 Giovanni Conforti a Damiano Macedonio b Vladimiro Sassone b a University of Dortmund b University of Sussex Abstract Bigraphs are emerging as a (meta-)model for concurrent
More informationTechnical Report Sequential Proximity
Technical Report Sequential Proximity Towards Provably Scalable Concurrent Search Algorithms Karolos Antoniadis, Rachid Guerraoui, Julien Stainer, and Vasileios Trigonakis École Polytechnique Fédérale
More informationModel Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies
Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies Tom Henzinger EPFL Three Verification Communities Model checking: -automatic, but inefficient
More information