Dependent types and explicit substitutions: a meta-theoretical development

2001 ◽  
Vol 11 (1) ◽  
pp. 91-129 ◽  
Author(s):  
CÉSAR MUÑOZ

We present a dependent-type system for a λ-calculus with explicit substitutions. In this system, meta-variables, as well as substitutions, are first-class objects. We show that the system enjoys properties like type uniqueness, subject reduction, soundness, confluence, and weak normalization.

2009 ◽  
Vol 19 (5) ◽  
pp. 545-579 ◽  
Author(s):  
SHIN-CHENG MU ◽  
HSIANG-SHANG KO ◽  
PATRIK JANSSON

AbstractRelational program derivation is the technique of stepwise refining a relational specification to a program by algebraic rules. The program thus obtained is correct by construction. Meanwhile, dependent type theory is rich enough to express various correctness properties to be verified by the type checker. We have developed a library, AoPA (Algebra of Programming in Agda), to encode relational derivations in the dependently typed programming language Agda. A program is coupled with an algebraic derivation whose correctness is guaranteed by the type system. Two non-trivial examples are presented: an optimisation problem and a derivation of quicksort in which well-founded recursion is used to model terminating hylomorphisms in a language with inductive types.


1999 ◽  
Vol 9 (4) ◽  
pp. 335-359 ◽  
Author(s):  
HERMAN GEUVERS ◽  
ERIK BARENDSEN

We look at two different ways of interpreting logic in the dependent type system λP. The first is by a direct formulas-as-types interpretation à la Howard where the logical derivation rules are mapped to derivation rules in the type system. The second is by viewing λP as a Logical Framework, following Harper et al. (1987) and Harper et al. (1993). The type system is then used as the meta-language in which various logics can be coded.We give a (brief) overview of known (syntactical) results about λP. Then we discuss two issues in some more detail. The first is the completeness of the formulas-as-types embedding of minimal first-order predicate logic into λP. This is a remarkably complicated issue, a first proof of which appeared in Geuvers (1993), following ideas in Barendsen and Geuvers (1989) and Swaen (1989). The second issue is the minimality of λP as a logical framework. We will show that some of the rules are actually superfluous (even though they contribute nicely to the generality of the presentation of λP).At the same time we will attempt to provide a gentle introduction to λP and its various aspects and we will try to use little inside knowledge.


Author(s):  
JONATHAN IMMANUEL BRACHTHÄUSER ◽  
PHILIPP SCHUSTER ◽  
KLAUS OSTERMANN

Abstract Effect handlers are a promising way to structure effectful programs in a modular way. We present the Scala library Effekt, which is centered around capability passing and implemented in terms of a monad for multi-prompt delimited continuations. Effekt is the first library implementation of effect handlers that supports effect safety and effect polymorphism without resorting to type-level programming. We describe a novel way of achieving effect safety using intersection types and path-dependent types. The effect system of our library design fits well into the programming paradigm of capability passing and is inspired by the effect system of Zhang & Myers (2019, Proc. ACM Program. Lang.3(POPL), 5:1-5:29). Capabilities carry an abstract type member, which represents an individual effect type and reflects the use of the capability on the type level. We represent effect rows as the contravariant intersection of effect types. Handlers introduce capabilities and remove components of the intersection type. Reusing the existing type system of Scala, we get effect subtyping and effect polymorphism for free.


2004 ◽  
Vol 14 (1) ◽  
pp. 1-2
Author(s):  
GILLES BARTHE ◽  
PETER DYBJEN ◽  
PETER THIEMANN

Modern programming languages rely on advanced type systems that detect errors at compile-time. While the benefits of type systems have long been recognized, there are some areas where the standard systems in programming languages are not expressive enough. Language designers usually trade expressiveness for decidability of the type system. Some interesting programs will always be rejected (despite their semantical soundness) or be assigned uninformative types.


2008 ◽  
Vol 18 (3) ◽  
pp. 285-331 ◽  
Author(s):  
CHIERI SAITO ◽  
ATSUSHI IGARASHI ◽  
MIRKO VIROLI

AbstractFamily polymorphism has been proposed for object-oriented languages as a solution to supporting reusable yet type-safe mutually recursive classes. A key idea of family polymorphism is the notion of families, which are used to group mutually recursive classes. In the original proposal, due to the design decision that families are represented by objects, dependent types had to be introduced, resulting in a rather complex type system. In this article, we propose a simpler solution oflightweightfamily polymorphism, based on the idea that families are represented by classes rather than by objects. This change makes the type system significantly simpler without losing much expressive power of the language. Moreover, “family-polymorphic” methods now take a form of parametric methods; thus, it is easy to apply method type argument inference as in Java 5.0. To rigorously show that our approach is safe, we formalize the set of language features on top of Featherweight Java and prove that the type system is sound. An algorithm for type inference for family-polymorphic method invocations is also formalized and proved to be correct. Finally, a formal translation by erasure to Featherweight Java is presented; it is proved to preserve typing and execution results, showing that our new language features can be implemented in Java by simply extending the compiler.


2021 ◽  
Vol 5 (POPL) ◽  
pp. 1-32
Author(s):  
Pritam Choudhury ◽  
Harley Eades III ◽  
Richard A. Eisenberg ◽  
Stephanie Weirich
Keyword(s):  

2017 ◽  
Author(s):  
Evgenii Akentev ◽  
Alexander Tchitchigin ◽  
Larisa Safina ◽  
Manuel Mazzara

Jolie is a service-oriented programming language which comes with the formal speci cation of its type system. However, there is no tool to ensure that programs in Jolie are well-typed. In this paper we provide the results of building a type checker for Jolie as a part of its syntax and semantics formal model. We ex- press the type checker as a program with dependent types in Agda proof assistant which helps to ascertain that the type checker is correct.


2021 ◽  
Vol 5 (ICFP) ◽  
pp. 1-29
Author(s):  
Nikita Zyuzin ◽  
Aleksandar Nanevski

Programming languages with algebraic effects often track the computations’ effects using type-and-effect systems. In this paper, we propose to view an algebraic effect theory of a computation as a variable context; consequently, we propose to track algebraic effects of a computation with contextual modal types . We develop ECMTT, a novel calculus which tracks algebraic effects by a contextualized variant of the modal □ (necessity) operator, that it inherits from Contextual Modal Type Theory (CMTT). Whereas type-and-effect systems add effect annotations on top of a prior programming language, the effect annotations in ECMTT are inherent to the language, as they are managed by programming constructs corresponding to the logical introduction and elimination forms for the □ modality. Thus, the type-and-effect system of ECMTT is actually just a type system. Our design obtains the properties of local soundness and completeness, and determines the operational semantics solely by β-reduction, as customary in other logic-based calculi. In this view, effect handlers arise naturally as a witness that one context (i.e., algebraic theory) can be reached from another, generalizing explicit substitutions from CMTT. To the best of our knowledge, ECMTT is the first system to relate algebraic effects to modal types. We also see it as a step towards providing a correspondence in the style of Curry and Howard that may transfer a number of results from the fields of modal logic and modal type theory to that of algebraic effects.


Author(s):  
David Corfield

Type theory regards individuals as belonging to a specific type. In computer science type-checking measures ensure that a program will compute properly. We see typing in everyday speech too, when a ‘Who?’ question expects a person. To define a type, it is necessary to specify when two elements are equal. Such concerns with sorts and identity are at stake in metaphysics. A dependent type occurs where one type is parametrized by elements of another. The two related constructions of dependent sum and dependent product appear in natural language and modern mathematics. In logic, these constructions amount to the quantifiers central to Russell’s logic. Dependent types are formulated in terms of contexts constructed in an order, showing how some concepts presuppose others. There are strong resonances with the ideas of Collingwood. With the notion of dependency, we can now analyse event types properly, demonstrating their difference from object types.


Sign in / Sign up

Export Citation Format

Share Document