Accelerate Literature Icon
Want to do a literature review? Try our new Literature Review workflow

Permission-Based Separation Logic for Multithreaded Java Programs

  • Abstract
  • Highlights & Summary
  • PDF
  • Literature Map
  • Similar Papers
Abstract
Translate article icon Translate Article Star icon

This paper presents a program logic for reasoning about multithreaded Java-like programs with dynamic thread creation, thread joining and reentrant object monitors. The logic is based on concurrent separation logic. It is the first detailed adaptation of concurrent separation logic to a multithreaded Java-like language. The program logic associates a unique static access permission with each heap location, ensuring exclusive write accesses and ruling out data races. Concurrent reads are supported through fractional permissions. Permissions can be transferred between threads upon thread starting, thread joining, initial monitor entrancies and final monitor exits. In order to distinguish between initial monitor entrancies and monitor reentrancies, auxiliary variables keep track of multisets of currently held monitors. Data abstraction and behavioral subtyping are facilitated through abstract predicates, which are also used to represent monitor invariants, preconditions for thread starting and postconditions for thread joining. Value-parametrized types allow to conveniently capture common strong global invariants, like static object ownership relations. The program logic is presented for a model language with Java-like classes and interfaces, the soundness of the program logic is proven, and a number of illustrative examples are presented.

Similar Papers
  • Book Chapter
  • Cite Count Icon 32
  • 10.1007/978-3-540-79980-1_16
Separation Logic Contracts for a Java-Like Language with Fork/Join
  • Feb 27, 2008
  • Christian Haack + 1 more

We adapt a variant of permission-accounting separation logic to a concurrent Java-like language with fork/join. To support both concurrent reads and information hiding, we combine fractional permissions with abstract predicates. As an example, we present a separation logic contract for iterators that prevents data races and concurrent modifications. Our program logic is presented in an algorithmic style: we avoid structural rules for Hoare triples and formalize logical reasoning about typed heaps by natural deduction rules and a set of sound axioms. We show that verified programs satisfy the following properties: data race freedom, absence of null-dereferences and partial correctness.KeywordsData RaceSeparation LogicClass AxiomPosix ThreadClass FrameThese keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

  • PDF Download Icon
  • Research Article
  • Cite Count Icon 4
  • 10.1145/3563326
Fractional resources in unbounded separation logic
  • Oct 31, 2022
  • Proceedings of the ACM on Programming Languages
  • Thibault Dardinier + 2 more

Many separation logics support fractional permissions to distinguish between read and write access to a heap location, for instance, to allow concurrent reads while enforcing exclusive writes. Fractional permissions extend to composite assertions such as (co)inductive predicates and magic wands by allowing those to be multiplied by a fraction. Typical separation logic proofs require that this multiplication has three key properties: it needs to distribute over assertions, it should permit fractions to be factored out from assertions, and two fractions of the same assertion should be combinable into one larger fraction. Existing formal semantics incorporating fractional assertions into a separation logic define multiplication semantically (via models), resulting in a semantics in which distributivity and combinability do not hold for key resource assertions such as magic wands, and fractions cannot be factored out from a separating conjunction. By contrast, existing automatic separation logic verifiers define multiplication syntactically, resulting in a different semantics for which it is unknown whether distributivity and combinability hold for all assertions. In this paper, we present a novel semantics for separation logic assertions that allows states to hold more than a full permission to a heap location during the evaluation of an assertion. By reimposing upper bounds on the permissions held per location at statement boundaries, we retain key properties of separation logic, in particular, the frame rule. Our assertion semantics unifies semantic and syntactic multiplication and thereby reconciles the discrepancy between separation logic theory and tools and enjoys distributivity, factorisability, and combinability. We have formalised our semantics and proved its properties in Isabelle/HOL.

  • Research Article
  • Cite Count Icon 4
  • 10.1002/spe.2126
A generic static analyzer for multithreaded Java programs
  • May 9, 2012
  • Software: Practice and Experience
  • P Ferrara

SUMMARYIn this paper, we present heckmate, the first generic static analyzer of multithreaded Java programs based on abstract interpretation. heckmate can be tuned at different levels of precision and efficiency in order to prove various properties (e.g., absence of divisions by zero and data races), and it is sound for multithreaded programs. It supports all the most relevant features of Java multithreading, such as dynamic thread creation, runtime creation of monitors, and dynamic allocation of memory. The experimental results demonstrate that heckmate is accurate and efficient enough to analyze programs with some thousands of statements and a potentially infinite number of threads. Copyright © 2012 John Wiley & Sons, Ltd.

  • PDF Download Icon
  • Book Chapter
  • Cite Count Icon 8
  • 10.1007/978-3-030-53291-8_13
Reasoning over Permissions Regions in Concurrent Separation Logic
  • Jan 1, 2020
  • Computer Aided Verification
  • James Brotherston + 3 more

We propose an extension of separation logic with fractional permissions, aimed at reasoning about concurrent programs that share arbitrary regions or data structures in memory. In existing formalisms, such reasoning typically either fails or is subject to stringent side conditions on formulas (notably precision) that significantly impair automation. We suggest two formal syntactic additions that collectively remove the need for such side conditions: first, the use of both “weak” and “strong” forms of separating conjunction, and second, the use of nominal labels from hybrid logic. We contend that our suggested alterations bring formal reasoning with fractional permissions in separation logic considerably closer to common pen-and-paper intuition, while imposing only a modest bureaucratic overhead.

  • Research Article
  • Cite Count Icon 20
  • 10.1016/j.entcs.2011.09.018
Step-Indexed Kripke Model of Separation Logic for Storable Locks
  • Sep 1, 2011
  • Electronic Notes in Theoretical Computer Science
  • Alexandre Buisse + 2 more

Step-Indexed Kripke Model of Separation Logic for Storable Locks

  • Research Article
  • Cite Count Icon 72
  • 10.1016/j.entcs.2005.11.059
Variables as Resource in Separation Logic
  • May 1, 2006
  • Electronic Notes in Theoretical Computer Science
  • Richard Bornat + 2 more

Variables as Resource in Separation Logic

  • Book Chapter
  • Cite Count Icon 123
  • 10.1007/978-3-540-71316-6_13
On the Relationship Between Concurrent Separation Logic and Assume-Guarantee Reasoning
  • Jan 1, 2007
  • Xinyu Feng + 2 more

We study the relationship between Concurrent Separation Logic (CSL) and the assume-guarantee (A-G) method (a.k.a. rely-guarantee method). We show in three steps that CSL can be treated as a specialization of the A-G method for well-synchronized concurrent programs. First, we present an A-G based program logic for a low-level language with built-in locking primitives. Then we extend the program logic with explicit separation of “private data” and “shared data”, which provides better memory modularity. Finally, we show that CSL (adapted for the low-level language) can be viewed as a specialization of the extended A-G logic by enforcing the invariant that “shared resources are well-formed outside of critical regions”. This work can also be viewed as a different approach (from Brookes’) to proving the soundness of CSL: our CSL inference rules are proved as lemmas in the A-G based logic, whose soundness is established following the syntactic approach to proving soundness of type systems.

  • Conference Article
  • Cite Count Icon 17
  • 10.1109/sp40001.2021.00003
Compositional Non-Interference for Fine-Grained Concurrent Programs
  • May 1, 2021
  • Lirias (KU Leuven)
  • Dan Frumin + 2 more

\n Contains fulltext :\n 230712.pdf (Author’s version preprint ) (Closed access)\n

  • Book Chapter
  • Cite Count Icon 3
  • 10.1007/978-3-031-17436-0_19
Verifying Reachability for TSO Programs with Dynamic Thread Creation
  • Jan 1, 2022
  • Parosh Aziz Abdulla + 4 more

The verification of reachability properties for programs under weak memory models is a hard problem, even undecidable in some cases. The decidability of this problem has been investigated so far in the case of static programs where the number of threads does not change during execution. However, dynamic thread creation is crucial in asynchronous concurrent programming. In this paper, we address the decidability of the reachability problem for dynamic concurrent programs running under TSO. An important issue when considering a TSO model in this case is maintaining causality precedence between operations issued by threads and those issued by their children. We propose a general TSO model that respects causality and prove that the reachability problem for programs with dynamic creation of threads is decidable.

  • Conference Article
  • Cite Count Icon 6
  • 10.1145/1924520.1924524
Modular verification of linked lists with views via separation logic
  • Jun 22, 2010
  • Jonas Braband Jensen + 2 more

We present a separation logic specification and verification of linked lists with views, a data structure from the C5 collection library for C#. A view is a generalization of the well-known concept of an iterator. Linked lists with views form an interesting case study for verification since they allow mutation of multiple possibly-overlapping views of the same underlying list. For modularity, we present our specification in a fragment of higher-order separation logic and use abstract predicates to give a specification with respect to which clients can be proved correct. We introduce a novel mathematical model of lists with views, and formulate succinct modular abstract specifications of the operations on the data structure. To show that the concrete implementation realizes the specification, we use fractional permissions in a novel way to capture the sharing of data between views and their underlying list.We conclude by suggesting directions for future research that arose from conducting this case study.

  • Research Article
  • Cite Count Icon 8
  • 10.5381/jot.2011.10.1.a2
Modular Verification of Linked Lists with Views via Separation Logic.
  • Jan 1, 2011
  • The Journal of Object Technology
  • Jonas Braband Jensen + 2 more

We present a separation logic specification and verification of linked lists with views, a data structure from the C5 collection library for C#. A view is a generalization of the well-known concept of an iterator. Linked lists with views form an interesting case study for verification since they allow mutation of multiple possibly-overlapping views of the same underlying list. For modularity, we present our specification in a fragment of higher-order separation logic and use abstract predicates to give a specification with respect to which clients can be proved correct. We introduce a novel mathematical model of lists with views, and formulate succinct modular abstract specifications of the operations on the data structure. To show that the concrete implementation realizes the specification, we use fractional permissions in a novel way to capture the sharing of data between views and their underlying list.We conclude by suggesting directions for future research that arose from conducting this case study.

  • Conference Article
  • Cite Count Icon 5
  • 10.1145/3209108.3209116
An Asynchronous Soundness Theorem for Concurrent Separation Logic
  • Jul 9, 2018
  • Paul-André Melliès + 1 more

Concurrent separation logic (CSL) is a specification logic for concurrent imperative programs with shared memory and locks. In this paper, we develop a concurrent and interactive account of the logic inspired by asynchronous game semantics. To every program C, we associate a pair of asynchronous transition systems [C]S and [C]L which describe the operational behavior of the Code when confronted to its Environment or Frame --- both at the level of machine states (S) and of machine instructions and locks (L). We then establish that every derivation tree π of a judgment Γ ⊢ {P}C{Q} defines a winning and asynchronous strategy [π]Sep with respect to both asynchronous semantics [C]S and [C]L. From this, we deduce an asynchronous soundness theorem for CSL, which states that the canonical map ℒ: [C]S~[C]L, from the stateful semantics [C]S to the stateless semantics [C]L satisfies a basic fibrational property. We advocate that this provides a clean and conceptual explanation for the usual soundness theorem of CSL, including the absence of data races.

  • Book Chapter
  • Cite Count Icon 19
  • 10.1007/978-3-540-69166-2_14
Conflict Analysis of Programs with Procedures, Dynamic Thread Creation, and Monitors
  • Jul 16, 2008
  • Peter Lammich + 1 more

We study conflict detection for programs with procedures, dynamic thread creation and a fixed finite set of (reentrant) monitors. We show that deciding the existence of a conflict is NP-complete for our model (that abstracts guarded branching by nondeterministic choice) and present a fixpoint-based complete conflict detection algorithm. Our algorithm needs worst-case exponential time in the number of monitors, but is linear in the program size.KeywordsOperational SemanticConstraint SystemClosure PropertyControl NodeAbstract DomainThese keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

  • Conference Article
  • Cite Count Icon 82
  • 10.1145/964001.964020
Local reasoning about a copying garbage collector
  • Jan 1, 2004
  • Lars Birkedal + 2 more

We present a programming language, model, and logic appropriate for implementing and reasoning about a memory management system. We then state what is meant by correctness of a copying garbage collector, and employ a variant of the novel separation logics [18, 23] to formally specify partial correctness of Cheney's copying garbage collector [8]. Finally, we prove that our implementation of Cheney's algorithm meets its specification, using the logic we have given, and auxiliary variables [19].

  • Research Article
  • Cite Count Icon 6
  • 10.1145/982962.964020
Local reasoning about a copying garbage collector
  • Jan 1, 2004
  • ACM SIGPLAN Notices
  • Lars Birkedal + 2 more

We present a programming language, model, and logic appropriate for implementing and reasoning about a memory management system. We then state what is meant by correctness of a copying garbage collector, and employ a variant of the novel separation logics [18, 23] to formally specify partial correctness of Cheney's copying garbage collector [8]. Finally, we prove that our implementation of Cheney's algorithm meets its specification, using the logic we have given, and auxiliary variables [19].

Save Icon
Up Arrow
Open/Close
Setting-up Chat
Loading Interface