Concurrent Separation Logic is a resource-sensitive logic for fault-free partial correctness of concurrent programs with shared mutable state, combining separation logic with Owicki-Gries inference rules, in a manner proposed by Peter [email protected]?Hearn. The Owicki-Gries rules and [email protected][email protected]?s original logic lacked compositionality, being limited to programs with a rigid parallel structure, because of a crucial constraint that ''no other process modifies''certain variables, imposed as a side condition in the inference rule for conditional critical regions. In prior work we proposed a more general formulation of a concurrent separation logic using resource contexts, and we offered a soundness proof based on a trace semantics. Recently Ian Wehrman and Josh Berdine discovered an example showing that this soundness proof relies on a hidden assumption, tantamount to ''no concurrent modification'', so that the proposed logic also suffices only for rigid programs. Here we show that, with a natural and simple adjustment we can avoid this problem. The key idea is to augment each assertion with a ''rely set'' of variables, assumed to be unmodified by other processes, and adjust the inference rules to validate and take advantage of these assumptions. This revised concurrent separation logic is compositional, allowing rigid and non-rigid programs, and the extra constraints imposed by rely set requirements ensure soundness. At the same time, we relax the Owicki-Gries constraints on the use of critical variables, allowing variables to be protected by multiple resources and building into the logic a simpler, yet more general, protection discipline. In the revised logic, a process wanting to write to a shared variable must acquire all resources that protect it, while a process wishing to read a shared variable need only acquire one such resource. This generalization brings concurrent separation logic closer in spirit to permission-based logics, in which processes may be allowed to perform concurrent reads.
[1]
永田 守男,et al.
Verifying Properties of Parallel Programs : An Axiomatic Approach
,
1976
.
[2]
John C. Reynolds,et al.
Syntactic control of interference for separation logic
,
2012,
POPL '12.
[3]
Charles Antony Richard Hoare.
Towards a theory of parallel programming
,
2002
.
[4]
Peter W. O'Hearn,et al.
Permission accounting in separation logic
,
2005,
POPL '05.
[5]
David Michael Ritchie Park,et al.
On the Semantics of Fair Parallelism
,
1979,
Abstract Software Specifications.
[6]
Peter W. O'Hearn,et al.
Resources, concurrency, and local reasoning
,
2007
.
[7]
Stephen D. Brookes,et al.
Variables as Resource for Shared-Memory Programs: Semantics and Soundness
,
2006,
MFPS.
[8]
Stephen D. Brookes,et al.
A Semantics for Concurrent Separation Logic
,
2004,
CONCUR.
[9]
John Tang Boyland,et al.
Checking Interference with Fractional Permissions
,
2003,
SAS.
[10]
John C. Reynolds,et al.
Separation logic: a logic for shared mutable data structures
,
2002,
Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.