7 research outputs found

    From dynamic binding to state via modal possibility

    Full text link
    In this paper we propose a typed, purely functional calculus for state (with second-class locations) in which types reflect the dichotomy between reading from and writing into the global store. This is in contrast to the usual formulation of state via monads, where the primitives for reading and writing introduce the same monadic type constructor. We hope to argue that making this distinction is useful, simple, and has strong logical foundations. Our type system is based on the proof-term calculus for constructive modal logic S4, which has two modal type operators: for neces-sity and 3 for possibility. We extend this calculus with the notion of names (which stand for locations) and generalize to indexed fami-lies of modal operators (indexed by sets of names). Then, the modal type CA classifies computations of type A which read from store locations listed in the set C. The dual type 3CA classifies compu-tations which first write into the locations from C and than use the changed store to obtain a value of type A. There are several benefits to this development. First, the necessita-tion fragment of the language is interesting in its own: it formulates a calculus of dynamic binding. Second, the possibility operator 3 is a monad, thus forcing the single-threading of memory writes, but not of memory reads (as these are associated with ). Finally, the different status of reads and writes gives rise to a natural way of expressing the allocation of uninitialized memory while also pro-viding guarantees that only initialized locations are dereferenced

    Reconciling positional and nominal binding

    Full text link
    We define an extension of the simply-typed lambda calculus where two different binding mechanisms, by position and by name, nicely coexist. In the former, as in standard lambda calculus, the matching between parameter and argument is done on a positional basis, hence alpha-equivalence holds, whereas in the latter it is done on a nominal basis. The two mechanisms also respectively correspond to static binding, where the existence and type compatibility of the argument are checked at compile-time, and dynamic binding, where they are checked at run-time.Comment: In Proceedings ITRS 2012, arXiv:1307.784

    Constrained Polymorphic Types for a Calculus with Name Variables

    Get PDF
    We extend the simply-typed lambda-calculus with a mechanism for dynamic rebinding of code based on parametric nominal interfaces. That is, we introduce values which represent single fragments, or families of named fragments, of open code, where free variables are associated with names which do not obey alpha-equivalence. In this way, code fragments can be passed as function arguments and manipulated, through their nominal interface, by operators such as rebinding, overriding and renaming. Moreover, by using name variables, it is possible to write terms which are parametric in their nominal interface and/or in the way it is adapted, greatly enhancing expressivity. However, in order to prevent conflicts when instantiating name variables, the name-polymorphic types of such terms need to be equipped with simple {inequality} constraints. We show soundness of the type system

    Combining Effects and Coeffects via Grading

    Get PDF
    This is the author accepted manuscript. It is currently under an indefinite embargo pending publication by the Association for Computing Machinery.Effects\textit{Effects} and coeffects\textit{coeffects} are two general, complementary aspects of program behaviour. They roughly correspond to computations which change the execution context (effects) versus computations which make demands on the context (coeffects). Effectful features include partiality, non-determinism, input-output, state, and exceptions. Coeffectful features include resource demands, variable access, notions of linearity, and data input requirements. The effectful or coeffectful behaviour of a program can be captured and described via type-based analyses, with fine grained information provided by monoidal effect annotations and semiring coeffects. Various recent work has proposed models for such typed calculi in terms of graded (strong) monads\textit{graded (strong) monads} for effects and graded (monoidal) comonads\textit{graded (monoidal) comonads} for coeffects. Effects and coeffects have been studied separately so far, but in practice many computations are both effectful and coeffectful, e.g., possibly throwing exceptions but with resource requirements. To remedy this, we introduce a new general calculus with a combined effect-coeffect system\textit{effect-coeffect system}. This can describe both the changes\textit{changes} and requirements\textit{requirements} that a program has on its context, as well as interactions between these effectful and coeffectful features of computation. The effect-coeffect system has a denotational model in terms of effect-graded monads and coeffect-graded comonads where interaction is expressed via the novel concept of graded distributive laws\textit{graded distributive laws}. This graded semantics unifies the syntactic type theory with the denotational model. We show that our calculus can be instantiated to describe in a natural way various different kinds of interaction between a program and its evaluation context.Orchard was supported by EPSRC grant EP/M026124/1 and EP/K011715/1 (whilst previously at Imperial College London), Katsumata by JSPS KAKENHI grant JP15K00014, Uustalu by Estonian Min. of Educ. and Res. grant IUT33-13 and Estonian Sci. Found. grant 9475. Gaboardi’s work was done in part while at the University of Dundee, UK supported by EPSRC grant EP/M022358/1

    Software Technologies - 8th International Joint Conference, ICSOFT 2013 : Revised Selected Papers

    Get PDF

    Model and Proof Theory of Constructive ALC, Constructive Description Logics

    Get PDF
    Description logics (DLs) represent a widely studied logical formalism with a significant impact in the field of knowledge representation and the Semantic Web. However, they are equipped with a classical descriptive semantics that is characterised by a platonic notion of truth, being insufficiently expressive to deal with evolving and incomplete information, as from data streams or ongoing processes. Such partially determined and incomplete knowledge can be expressed by relying on a constructive semantics. This thesis investigates the model and proof theory of a constructive variant of the basic description logic ALC, called cALC. The semantic dimension of constructive DLs is investigated by replacing the classical binary truth interpretation of ALC with a constructive notion of truth. This semantic characterisation is crucial to represent applications with partial information adequately, and to achieve both consistency under abstraction as well as robustness under refinement, and on the other hand is compatible with the Curry-Howard isomorphism in order to form the cornerstone for a DL-based type theory. The proof theory of cALC is investigated by giving a sound and complete Hilbert-style axiomatisation, a Gentzen-style sequent calculus and a labelled tableau calculus showing finite model property and decidability. Moreover, cALC can be strengthened towards normal intuitionistic modal logics and classical ALC in terms of sound and complete extensions and hereby forms a starting point for the systematic investigation of a constructive correspondence theory.Beschreibungslogiken (BLen) stellen einen vieluntersuchten logischen Formalismus dar, der den Bereich der Wissensrepräsentation und das Semantic Web signifikant geprägt hat. Allerdings basieren BLen meist auf einer klassischen deskriptiven Semantik, die gekennzeichnet ist durch einen idealisierten Wahrheitsbegriff nach Platons Ideenlehre, weshalb diese unzureichend ausdrucksstark sind, um in Entwicklung befindliches und unvollständiges Wissen zu repräsentieren, wie es beispielsweise durch Datenströme oder fortlaufende Prozesse generiert wird. Derartiges partiell festgelegtes und unvollständiges Wissen lässt sich auf der Basis einer konstruktiven Semantik ausdrücken. Diese Arbeit untersucht die Model- und Beweistheorie einer konstruktiven Variante der Basis-BL ALC, die im Folgenden als cALC bezeichnet wird. Die Semantik dieser konstruktiven Beschreibungslogik resultiert daraus, die traditionelle zweiwertige Interpretation logischer Aussagen des Systems ALC durch einen konstruktiven Wahrheitsbegriff zu ersetzen. Eine derartige Interpretation ist die Voraussetzung dafür, um einerseits Anwendungen mit partiellem Wissen angemessen zu repräsentieren, und sowohl die Konsistenz logischer Aussagen unter Abstraktion als auch ihre Robustheit unter Verfeinerung zu gewährleisten, und andererseits um den Grundstein für eine Beschreibungslogik-basierte Typentheorie gemäß dem Curry-Howard Isomorphismus zu legen. Die Ergebnisse der Untersuchung der Beweistheorie von cALC umfassen eine vollständige und korrekte Hilbert Axiomatisierung, einen Gentzen Sequenzenkalkül, und ein semantisches Tableaukalkül, sowie Beweise zur endlichen Modelleigenschaft und Entscheidbarkeit. Darüber hinaus kann cALC zu normaler intuitionistischer Modallogik und klassischem ALC durch vollständige und korrekte Erweiterungen ausgebaut werden, und bildet damit einen Startpunkt für die systematische Untersuchung einer konstruktiven Korrespondenztheorie
    corecore