• Keine Ergebnisse gefunden

Exercise 1.2 (Formulas) Prove the following properties of separation logic formulas

N/A
N/A
Protected

Academic year: 2021

Aktie "Exercise 1.2 (Formulas) Prove the following properties of separation logic formulas"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

SS 2014 23.04.2014 Exercises to the lecture

Concurrency Theory Sheet 1

Roland Meyer, Viktor Vafeiadis Delivery until 29.04.2014 at 12h Exercise 1.1 (Data Structures in Separation Logic)

Characterize data structures in separation logic. More precisely, define predicates llist(x), dllist(x), and tree(x), so that

• llist(x) means thatx points to a linked list,

• dllist(x) points to a doubly linked list, and

• treea,b(x) points to a binary search tree with values betweenaand b.

Exercise 1.2 (Formulas)

Prove the following properties of separation logic formulas:

• ∗is commutative and associative and (P ∗emp)⇔P

• If (P−∗◦Q)his defined as ∃h1.P h1∧Q(h]h1), then (P −∗◦Q)h⇔ ¬(P −∗¬Q)h

• P∗(P −∗Q)`Q

• 107→20−∗107→206⇔107→20−∗◦107→20

• lsα(x, y)∗lsβ(y, z)⇒lsαβ(x, z)

Exercise 1.3 (Sorting)

Using the syntax given in the lecture, present a programC that merges sorted lists (like in the Heapsort algorithm). Hence, given two sorted listsL1 andL2, the program returns a sorted listLcontaining precisely the elements fromL1 andL2. Give formulasP andQ so that{P}C{Q}holds.

Hint: To define P and Q, you can make use of the the list segment predicate lsα from the lecture. Furthermore, you may have to introduce predicates that describe sorted lists and lists that are permutations of each other.

Delivery until 29.04.2014 at 12h into the box next to 34-401.4

Referenzen