224 research outputs found
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
Composing Interfering Abstract Protocols
The undisciplined use of shared mutable state can be a source of program errors when aliases unsafely interfere with each other.
While protocol-based techniques to reason about interference abound, they do not address two practical concerns: the decidability of protocol composition and its integration with protocol abstraction.
We show that our composition procedure is decidable and that it ensures safe interference even when composing abstract protocols.
To evaluate the expressiveness of our protocol framework for safe shared memory interference, we show how this same protocol framework can be used to model safe, typeful message-passing concurrency idioms
Revisiting Decidable Bounded Quantification, via Dinaturality
We use a semantic interpretation to investigate the problem of defining an
expressive but decidable type system with bounded quantification. Typechecking
in the widely studied System Fsub is undecidable thanks to an undecidable
subtyping relation, for which the culprit is the rule for subtyping bounded
quantification. Weaker versions of this rule, allowing decidable subtyping,
have been proposed. One of the resulting type systems (Kernel Fsub) lacks
expressiveness, another (System Fsubtop) lacks the minimal typing property and
thus has no evident typechecking algorithm.
We consider these rules as defining distinct forms of bounded quantification,
one for interpreting type variable abstraction, and the other for type
instantiation. By giving a semantic interpretation for both in terms of
unbounded quantification, using the dinaturality of type instantiation with
respect to subsumption, we show that they can coexist within a single type
system. This does have the minimal typing property and thus a simple
typechecking procedure.
We consider the fragments of this unified type system over types which
contain only one form of bounded quantifier. One of these is equivalent to
Kernel Fsub, while the other can type strictly more terms than System Fsubtop
but the same set of beta-normal terms. We show decidability of typechecking for
this fragment, and thus for System Fsubtop typechecking of beta-normal terms.Comment: In Mathematical Semantics of Programming Languages (MFPS) '2
Towards a Java Subtyping Operad
The subtyping relation in Java exhibits self-similarity. The self-similarity
in Java subtyping is interesting and intricate due to the existence of wildcard
types and, accordingly, the existence of three subtyping rules for generic
types: covariant subtyping, contravariant subtyping and invariant subtyping.
Supporting bounded type variables also adds to the complexity of the subtyping
relation in Java and in other generic nominally-typed OO languages such as C#
and Scala. In this paper we explore defining an operad to model the
construction of the subtyping relation in Java and in similar generic
nominally-typed OO programming languages. Operads, from category theory, are
frequently used to model self-similar phenomena. The Java subtyping operad, we
hope, will shed more light on understanding the type systems of generic
nominally-typed OO languages.Comment: 13 page
- …