13 research outputs found
On Generalized Records and Spatial Conjunction in Role Logic
We have previously introduced role logic as a notation for describing
properties of relational structures in shape analysis, databases and knowledge
bases. A natural fragment of role logic corresponds to two-variable logic with
counting and is therefore decidable. We show how to use role logic to describe
open and closed records, as well the dual of records, inverse records. We
observe that the spatial conjunction operation of separation logic naturally
models record concatenation. Moreover, we show how to eliminate the spatial
conjunction of formulas of quantifier depth one in first-order logic with
counting. As a result, allowing spatial conjunction of formulas of quantifier
depth one preserves the decidability of two-variable logic with counting. This
result applies to two-variable role logic fragment as well. The resulting logic
smoothly integrates type system and predicate calculus notation and can be
viewed as a natural generalization of the notation for constraints arising in
role analysis and similar shape analysis approaches.Comment: 30 pages. A version appears in SAS 200
On Spatial Conjunction as Second-Order Logic
Spatial conjunction is a powerful construct for reasoning about dynamically
allocated data structures, as well as concurrent, distributed and mobile
computation. While researchers have identified many uses of spatial
conjunction, its precise expressive power compared to traditional logical
constructs was not previously known. In this paper we establish the expressive
power of spatial conjunction. We construct an embedding from first-order logic
with spatial conjunction into second-order logic, and more surprisingly, an
embedding from full second order logic into first-order logic with spatial
conjunction. These embeddings show that the satisfiability of formulas in
first-order logic with spatial conjunction is equivalent to the satisfiability
of formulas in second-order logic. These results explain the great expressive
power of spatial conjunction and can be used to show that adding unrestricted
spatial conjunction to a decidable logic leads to an undecidable logic. As one
example, we show that adding unrestricted spatial conjunction to two-variable
logic leads to undecidability. On the side of decidability, the embedding into
second-order logic immediately implies the decidability of first-order logic
with a form of spatial conjunction over trees. The embedding into spatial
conjunction also has useful consequences: because a restricted form of spatial
conjunction in two-variable logic preserves decidability, we obtain that a
correspondingly restricted form of second-order quantification in two-variable
logic is decidable. The resulting language generalizes the first-order theory
of boolean algebra over sets and is useful in reasoning about the contents of
data structures in object-oriented languages.Comment: 16 page
A Logic of Reachable Patterns in Linked Data-Structures
We define a new decidable logic for expressing and checking invariants of
programs that manipulate dynamically-allocated objects via pointers and
destructive pointer updates. The main feature of this logic is the ability to
limit the neighborhood of a node that is reachable via a regular expression
from a designated node. The logic is closed under boolean operations
(entailment, negation) and has a finite model property. The key technical
result is the proof of decidability. We show how to express precondition,
postconditions, and loop invariants for some interesting programs. It is also
possible to express properties such as disjointness of data-structures, and
low-level heap mutations. Moreover, our logic can express properties of
arbitrary data-structures and of an arbitrary number of pointer fields. The
latter provides a way to naturally specify postconditions that relate the
fields on entry to a procedure to the fields on exit. Therefore, it is possible
to use the logic to automatically prove partial correctness of programs
performing low-level heap mutations
The First-Order Theory of Sets with Cardinality Constraints is Decidable
We show that the decidability of the first-order theory of the language that
combines Boolean algebras of sets of uninterpreted elements with Presburger
arithmetic operations. We thereby disprove a recent conjecture that this theory
is undecidable. Our language allows relating the cardinalities of sets to the
values of integer variables, and can distinguish finite and infinite sets. We
use quantifier elimination to show the decidability and obtain an elementary
upper bound on the complexity.
Precise program analyses can use our decidability result to verify
representation invariants of data structures that use an integer field to
represent the number of stored elements.Comment: 18 page