Subido por wefew

# Algebra, Logic, Locality, Concurrency

Anuncio
```Algebra, Logic, Locality, Concurrency
Peter W. O’Hearn
Queen Mary University of London
This talk reports on ongoing work – with Tony Hoare, Akbar Hussain, Bernhard
Möller, Rasmus Petersen, Georg Struth, Ian Wehrman, and others – on models
and logics for concurrent processes [10,6,5]. The approach we are taking abstracts
from syntax or particular models. Message passing and shared memory process
interaction, and strong (interleaving) and weak (partial order) approaches to
sequencing, are accomodated as diﬀerent models of the same core axioms. Rules
of program logic, related to Hoare and Separation logics, ﬂow at once from the
algebraic axioms. So, one gets a generic program logic from the algebra, which
holds for a range of concrete models.
The most notable amongst the algebra laws is an ordered cousin of the exchange law of 2-categories or bicategories, which here links primitives for sequential and parallel composition
(p r); (q s) (p; q) (r; s).
This law was was noticed in work on pomsets and traces in the 1980s and
1990s [4,1], and emphasized recently in the formulation of Concurrent Kleene
Algebra [5]. An important observation of [5] is that by viewing the pre/post
spec {p} c {q} as a certain relation in the algebra – there are actually two such,
p; c q and c; q p – one obtains a number of rules for program logic. The use
of ; to separate the precondition and program, or program and postcondition,
has an interesting consequence: if the sequential composition is a ‘weak’ one that
allows statement re-ordering (as in weak or relaxed memory models that do not
guarantee sequentially consistent behaviour, or more generally as available in
partial order models such as pomsets or event structures [11,9]) then we still
obtain rules of sequential Hoare logic. And when combined with using the
exchange law, it results in very general versions of the rules
{P1 } C1 {Q1 } {P2 } C2 {Q2 }
Concurrency
{P1 ∗ P2 } C1 C2 {Q1 ∗ Q2 }
{P } C {Q}
Frame
{P ∗ F } C {Q ∗ F }
which in Concurrent Separation Logic support modular reasoning about concurrent processes [7], where ∗ is the separating conjunction (which holds when its
conjuncts holds of separate resources).
A remarkable fact is that the initial conception of these rules from Concurrent Separation Logic is strongly based on an idea of ‘locality of resource access’
[8,2,3], where such intuitions do not seem to be present in the algebraic theory. For instance, in the frame rule we understand that {P } C {Q} implies that
command C only accesses those resources described by precondition P , and
this justiﬁes tacking on a description of separate resources that will thus not
be altered (the ∗F part). Similarly, in the concurrency rule we understand that
J.-P. Jouannaud and Z. Shao (Eds.): CPP 2011, LNCS 7086, pp. 3–4, 2011.
c Springer-Verlag Berlin Heidelberg 2011
4
P.W. O’Hearn
processes started in separate states will not trample on one another’s resources,
because of locality. The notion of ‘locality of resource access’ is a semantic notion
that underlies the semantics of Separation Logic: the soundness of the Frame and
Concurrency has been proven by validating properties of the semantics of programs that express locality of resource access (properties which incidentally are
independent of the syntax of the logic) [12,3]. However, such forms of justiﬁcation
are not needed at all in the algebra.
The understanding of this point – how locality and the algebra are related – is
a particular focus of the talk. We start from a standard model of resources, and
construct an algebra from it, making a link between the intuitions concerning locality of resource access and the axioms in the algebra. Perhaps surprisingly, the
algebra is seen to contain a general account of locality, which strictly generalizes
the modular reasoning of Concurrent Separation Logic [5].
On the other hand, the algebra has as instances concrete models that are far
removed conceptually from the resource models at the basis of Separation Logic
(e.g., models based on interleaving and independence of events), and this leads
to the question of whether it is possible to uniformly obtain eﬀective modular
reasoning techniques for a wide range of models of concurrency.
References
1. Bloom, S.L., Ésik, Z.: Free shuﬄe algebras in language varieties. Theor. Comput.
Sci. 163(1&amp;2), 55–98 (1996)
2. Brookes, S.D.: A semantics of concurrent separation logic. Theoretical Computer
Science 375(1-3), 227–270 (2007); Prelim. version appeared in CONCUR 2004
3. Calcagno, C., O’Hearn, P.W., Yang, H.: Local action and abstract separation logic.
In: LICS, pp. 366–378. IEEE Computer Society (2007)
4. Gischer, J.L.: The equational theory of pomsets. Theor. Comput. Sci. 61, 199–224
(1988)
5. Hoare, C.A.R., Hussain, A., Möller, B., O’Hearn, P.W., Petersen, R.L., Struth,
G.: On Locality and the Exchange Law for Concurrent Processes. In: Katoen, J.P., König, B. (eds.) CONCUR 2011 – Concurrency Theory. LNCS, vol. 6901, pp.
250–264. Springer, Heidelberg (2011)
6. Hoare, T., Möller, B., Struth, G., Wehrman, I.: Concurrent Kleene algebra and its
foundations. J. Log. Algebr. Program (2011); Preliminary verson in CONCUR 2009
7. O’Hearn, P.W.: Resources, concurrency and local reasoning. Theoretical Computer
Science 375(1-3), 271–307 (2007); Prelim. version appeared in CONCUR 2004
8. O’Hearn, P.W., Reynolds, J.C., Yang, H.: Local Reasoning about Programs that
Alter Data Structures. In: Fribourg, L. (ed.) CSL 2001 and EACSL 2001. LNCS,
vol. 2142, pp. 1–9. Springer, Heidelberg (2001)
9. Pratt, V.: Modelling concurrency with partial orders. International Journal of Parallel Programming 15(1), 33–71 (1986)
10. Wehrman, I., Hoare, C.A.R., O’Hearn, P.W.: Graphical models of separation logic.
Inf. Process. Lett. 109(17), 1001–1004 (2009)
11. Winskel, G.: Events in Computation. Ph.D. thesis, University of Edinburgh (1980)
12. Yang, H., O’Hearn, P.W.: A Semantic Basis for Local Reasoning. In: Nielsen,
M., Engberg, U. (eds.) FOSSACS 2002. LNCS, vol. 2303, pp. 402–416. Springer,
Heidelberg (2002)
```