Abstract
In order to support efficient compilation to modern architectures, mainstream programming languages, such as C/C\(++\) and Java, have adopted weak (or relaxed) memory models. According to these weak memory models, multithreaded programs are allowed to exhibit behaviours that would have been inconsistent under the traditional strong (i.e., sequentially consistent) memory model. This makes the task of reasoning about concurrent programs even more challenging. The GPS framework, developed by Turon et al. (ACM OOPSLA, pp 691–707, 2014), has made a step forward towards tackling this challenge for the release–acquire fragment of the C11 memory model. By integrating ghost states, per-location protocols and separation logic, GPS can successfully verify programs with release–acquire atomics. In this paper, we introduced GPS\(+\) to support a larger class of C11 programs, that is, programs with release–acquire atomics, relaxed atomics and release–acquire fences. Key elements of our proposed logic include two new types of assertions, a more expressive resource model and a set of new verification rules.
Similar content being viewed by others
Notes
Here we explain these examples in an intuitive manner, leaving the formal introductions of syntax and semantics to the next section.
Or via release sequences, which we do not consider in this paper.
In GPS, \(|r|\) represents the duplicable part of \(r\): \(r=r\oplus |r|\). For duplicable items in \(r\), like atomic values and the known escrow set, stripping keeps them unchanged. That is, we have \(|r|.\varSigma =r.\varSigma \), and if \(\ell _\mathtt {at}\) is an atomic location in \(r\) we have \(|r|.\varPi (\ell _\mathtt {at})=r.\varPi (\ell _\mathtt {at})\). For non-duplicable items, like non-atomic values, stripping removes them. For example, if \(\ell _\mathtt {na}\) is a non-atomic location in \(r\) we have \(|r|.\varPi (\ell _\mathtt {na})=\bot \). The value \(\diamond \) of ghost type \(\mathsf {Tok}\) is also not duplicable, and all ghost locations of type \(\mathsf {Tok}\) will be set as empty after stripping: \(|r|.g(\mathsf {Tok})(-)=\xi \).
References
Batty, M., Owens, S., Sarkar, S., Sewell, P., Weber, T.: Mathematizing C++ concurrency. In: Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’11, pp. 55–66. ACM, New York (2011)
Cohen, E., Dahlweid, M., Hillebrand, M., Leinenbach, D., Moskal, M., Santen, T., Schulte, W., Tobies, S.: VCC: a practical system for verifying concurrent C. In: International Conference on Theorem Proving in Higher Order Logics (TPHOLs ’09), pp. 23–42 (2009)
da Rocha Pinto, P., Dinsdale-Young, T., Gardner, P.: TaDA: a logic for time and data abstraction. In: ECOOP, pp. 207–231 (2014)
Dinsdale-Young, T., Dodds, M., Gardner, P., Parkinson, M.J., Vafeiadis, V.: Concurrent abstract predicates. In: ECOOP, pp. 504–528 (2010)
Dinsdale-Young, T., Birkedal, L., Gardner, P., Parkinson, M.J., Yang, H.: Views: compositional reasoning for concurrent programs. In: ACM POPL, pp. 287–300 (2013)
Dodds, M., Feng, X., Parkinson, M., Vafeiadis, V.: Deny-guarantee reasoning. In: ESOP, pp. 363–377 (2009)
Doko, M., Vafeiadis, V.: A Program Logic for C11 Memory Fences, pp. 413–430. Springer, Berlin (2016)
Feng, X.: Local rely-guarantee Reasoning. In: ACM POPL, pp. 315–327 (2009)
He, M., Vafeiadis, V., Qin, S., Ferreira, J.F.: GPS+: Reasoning About Fences and Relaxed Atomics (Technical Report) (2017). http://pls.tees.ac.uk/gpsp/report.pdf, School of Computing, Teesside University
ISO/IEC 9899:2011. Programming Language C (2011)
Jensen, J.B., Birkedal, L.: Fictional separation logic. In: ESOP, pp. 377–396 (2012)
Jones, C.B.: Tentative steps toward a development method for interfering programs. ACM TOPLAS 5, 596–619 (1983)
Jung, R., Swasey, D., Sieczkowski, F., Svendsen, K., Turon, A., Birkedal, L., Dreyer, D.: Iris: monoids and invariants as an orthogonal basis for concurrent reasoning. In: ACM POPL, pp. 637–650 (2015)
Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput. 28(9), 690–691 (1979)
Leino, K.R., Müller, P., Smans, J.: Verification of concurrent programs with Chalice. In: Foundations of Security Analysis and Design V, pp. 195–222 (2009)
Ley-Wild, R., Nanevski, A.: Subjective auxiliary state for coarse-grained concurrency. In: ACM POPL, pp. 561–574 (2013)
Manson, J., Pugh, W., Adve, S.V.: The Java memory model. In: ACM POPL, pp. 378–391 (2005)
Nanevski, A., Ley-Wild, R., Sergey, I., Delbianco, G.: Communicating state transition systems for fine-grained concurrent resources. In: ESOP, pp. 290–310 (2014)
O’Hearn, P.W.: Resources, concurrency, and local reasoning. Theor. Comput. Sci. 375(1–3), 271–307 (2007)
Svendsen, K., Birkedal, L.: Impredicative concurrent abstract predicates. In: ESOP, pp. 149–168 (2014)
Tassarotti, J., Dreyer, D., Vafeiadis, V.: Verifying read-copy-update in a logic for weak memory. In: ACM PLDI, Portland, OR, USA (2015)
Turon, A., Dreyer, D., Birkedal, L.: Unifying refinement and hoare-style reasoning in a logic for higher-order concurrency. In: ICFP, pp. 377–390 (2013)
Turon, A., Vafeiadis, V., Dreyer, D.: GPS: Navigating weak memory with ghosts, protocols, and separation. In: ACM OOPSLA, pp. 691–707 (2014)
Vafeiadis, V., Parkinson, M.J.: A marriage of rely/guarantee and separation logic. In: 18th International Conference on Concurrency Theory (CONCUR’07), volume 4703 of Lecture Notes in Computer Science, pp. 256–271 (2007)
Vafeiadis, V., Narayan, C.: Relaxed separation logic: a program logic for C11 concurrency. In: ACM OOPSLA, pp. 867–884 (2013)
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
He, M., Vafeiadis, V., Qin, S. et al. GPS\(+\): Reasoning About Fences and Relaxed Atomics. Int J Parallel Prog 46, 1157–1183 (2018). https://doi.org/10.1007/s10766-017-0518-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10766-017-0518-x