147 research outputs found

    A type- and scope-safe universe of syntaxes with binding: their semantics and proofs

    Get PDF
    Almost every programming language's syntax includes a notion of binder and corresponding bound occurrences, along with the accompanying notions of alpha-equivalence, capture-avoiding substitution, typing contexts, runtime environments, and so on. In the past, implementing and reasoning about programming languages required careful handling to maintain the correct behaviour of bound variables. Modern programming languages include features that enable constraints like scope safety to be expressed in types. Nevertheless, the programmer is still forced to write the same boilerplate over again for each new implementation of a scope safe operation (e.g., renaming, substitution, desugaring, printing, etc.), and then again for correctness proofs. We present an expressive universe of syntaxes with binding and demonstrate how to (1) implement scope safe traversals once and for all by generic programming; and (2) how to derive properties of these traversals by generic proving. Our universe description, generic traversals and proofs, and our examples have all been formalised in Agda and are available in the accompanying material available online at https://github.com/gallais/generic-syntax

    POPLMark reloaded: Mechanizing proofs by logical relations

    Get PDF
    We propose a new collection of benchmark problems in mechanizing the metatheory of programming languages, in order to compare and push the state of the art of proof assistants. In particular, we focus on proofs using logical relations (LRs) and propose establishing strong normalization of a simply typed calculus with a proof by Kripke-style LRs as a benchmark. We give a modern view of this well-understood problem by formulating our LR on well-typed terms. Using this case study, we share some of the lessons learned tackling this problem in different dependently typed proof environments. In particular, we consider the mechanization in Beluga, a proof environment that supports higher-order abstract syntax encodings and contrast it to the development and strategies used in general-purpose proof assistants such as Coq and Agda. The goal of this paper is to engage the community in discussions on what support in proof environments is needed to truly bring mechanized metatheory to the masses and engage said community in the crafting of future benchmarks

    A Type and Scope Safe Universe of Syntaxes with Binding: Their Semantics and Proofs

    Get PDF
    Almost every programming language’s syntax includes a notion of binder and corresponding bound occurrences, along with the accompanying notions of α-equivalence, capture avoiding substitution, typing contexts, runtime environments, and so on. In the past, implementing and reasoning about programming languages required careful handling to maintain the correct behaviour of bound variables. Modern programming languages include features that enable constraints like scope safety to be expressed in types. Nevertheless, the programmer is still forced to write the same boilerplate over again for each new implementation of a scope safe operation (e.g., renaming, substitution, desugaring, printing, etc.), and then again for correctness proofs. We present an expressive universe of syntaxes with binding and demonstrate how to (1) implement scope safe traversals once and for all by generic programming; and (2) how to derive properties of these traversals by generic proving. Our universe description, generic traversals and proofs, and our examples have all been formalised in Agda and are available in the accompanying material

    Needle & knot : binder boilerplate tied up

    No full text
    To lighten the burden of programming language mechanization, many approaches have been developed that tackle the substantial boilerplate which arises from variable binders. Unfortunately, the existing approaches are limited in scope. They typically do not support complex binding forms (such as multi-binders) that arise in more advanced languages, or they do not tackle the boilerplate due to mentioning variables and binders in relations. As a consequence, the human mechanizer is still unnecessarily burdened with binder boilerplate and discouraged from taking on richer languages. This paper presents Knot, a new approach that substantially extends the support for binder boilerplate. Knot is a highly expressive language for natural and concise specification of syntax with binders. Its meta-theory constructively guarantees the coverage of a considerable amount of binder boilerplate for well-formed specifications, including that for well-scoping of terms and context lookups. Knot also comes with a code generator, Needle, that specializes the generic boilerplate for convenient embedding in COQ and provides a tactic library for automatically discharging proof obligations that frequently come up in proofs of weakening and substitution lemmas of type-systems. Our evaluation shows, that Needle & Knot significantly reduce the size of language mechanizations (by 40% in our case study). Moreover, as far as we know, Knot enables the most concise mechanization of the POPLmark Challenge (1a + 2a) and is two-thirds the size of the next smallest. Finally, Knot allows us to mechanize for instance dependentlytyped languages, which is notoriously challenging because of dependent contexts and mutually-recursive sorts with variables

    Engineering scalable modelling Languages

    Full text link
    Tesis doctoral inédita leída en la Universidad Autónoma de Madrid, Escuela Politécnica Superior, Departamento de Ingeniería Informática. Fecha de lectura: 08-11-2019Esta tesis tiene embargado el acceso al texto completo hasta el 08-05-2021Model-Driven Engineering (MDE) aims at reducing the cost of system development by raising the level of abstraction at which developers work. MDE-based solutions frequently involve the creation of Domain-Specific Modelling Languages (DSMLs). WhilethedefinitionofDSMLsandtheir(sometimesgraphical)supportingenvironments are recurring activities in MDE, they are mostly developed ad-hoc from scratch. The construction of these environments requires high expertise by developers, which currently need to spend large efforts for their construction. This thesis focusses on the development of scalable modelling environments for DSMLs based on patterns. For this purpose, we propose a catalogue of modularity patterns that can be used to extend a modelling language with services related to modularization and scalability. More specifically, these patterns allows defining model fragmentation strategies, scoping and visibility rules, model indexing services, and scoped constraints. Once the patterns have been applied to the meta-model of a modelling language, we synthesize a customized modelling environment enriched with the defined services, which become applicable to both existing monolithic legacy models and new models. A second contribution of this thesis is a set of concepts and technologies to facilitate the creation of graphical editors. For this purpose, we define heuristics which identify structures in the DSML abstract syntax, and automatically assign their diagram representation. Using this approach, developers can create a graphical representation by default from a meta-model, which later can be customised. These contributions have been implemented in two Eclipse plug-ins called EMFSplitter and EMF-Stencil. On one hand, EMF-Splitter implements the catalogue of modularity patterns and, on the other hand, EMF-Stencil supports the heuristics and the generation of a graphical modelling environment. Both tools were evaluated in different case studies to prove their versatility, efficiency, and capabilitieEl Desarrollo de Software Dirigido por Modelos (MDE, por sus siglas en inglés) tiene como objetivo reducir los costes en el desarrollo de aplicaciones, elevando el nivel de abstracciónconelqueactualmentetrabajanlosdesarrolladores. Lassolucionesbasadas en MDE frecuentemente involucran la creación de Lenguajes de Modelado de Dominio Específico (DSML, por sus siglas en inglés). Aunque la definición de los DSMLs y sus entornos gráficos de modelado son actividades recurrentes en MDE, actualmente en la mayoría de los casos se desarrollan ad-hoc desde cero. La construcción de estos entornos requiere una alta experiencia por parte de los desarrolladores, que deben realizar un gran esfuerzo para construirlos. Esta tesis se centra en el desarrollo de entornos de modelado escalables para DSML basados en patrones. Para ello, se propone un catálogo de patrones de modularidad que se pueden utilizar para extender un lenguaje de modelado con servicios relacionados con la modularización y la escalabilidad. Específicamente, los patrones permiten definir estrategias de fragmentación de modelos, reglas de alcance y visibilidad, servicios de indexación de modelos y restricciones de alcance. Una vez que los patrones se han aplicado al meta-modelo de un lenguaje de modelado, se puede generar automáticamente un entorno de modelado personalizado enriquecido con los servicios definidos, que se vuelven aplicables tanto a los modelos monolíticos existentes, como a los nuevos modelos. Una segunda contribución de esta tesis es la propuesta de conceptos y tecnologías para facilitar la creación de editores gráficos. Para ello, definimos heurísticas que identifican estructuras en la sintaxis abstracta de los DSMLs y asignan automáticamente su representación en el diagrama. Usando este enfoque, los desarrolladores pueden crear una representación gráfica por defecto a partir de un meta-modelo. Estas contribuciones se implementaron en dos plug-ins de Eclipse llamados EMFSplitter y EMF-Stencil. Por un lado, EMF-Splitter implementa el catálogo de patrones y, por otro lado, EMF-Stencil implementa las heurísticas y la generación de un entorno de modelado gráfico. Ambas herramientas se han evaluado con diferentes casos de estudio para demostrar su versatilidad, eficiencia y capacidade

    Tealeaves: Structured Monads for Generic First-Order Abstract Syntax Infrastructure

    Get PDF
    Verifying the metatheory of a formal system in Coq involves a lot of tedious "infrastructural" reasoning about variable binders. We present Tealeaves, a generic framework for first-order representations of variable binding that can be used to develop this sort of infrastructure once and for all. Given a particular strategy for representing binders concretely, such as locally nameless or de Bruijn indices, Tealeaves allows developers to implement modules of generic infrastructure called backends that end users can simply instantiate to their own syntax. Our framework rests on a novel abstraction of first-order abstract syntax called a decorated traversable monad (DTM) whose equational theory provides reasoning principles that replace tedious induction on terms. To evaluate Tealeaves, we have implemented a multisorted locally nameless backend providing generic versions of the lemmas generated by LNgen. We discuss case studies where we instantiate this generic infrastructure to simply-typed and polymorphic lambda calculi, comparing our approach to other utilities

    Strategic polymorphism requires just two combinators!

    Get PDF
    In previous work, we introduced the notion of functional strategies: first-class generic functions that can traverse terms of any type while mixing uniform and type-specific behaviour. Functional strategies transpose the notion of term rewriting strategies (with coverage of traversal) to the functional programming paradigm. Meanwhile, a number of Haskell-based models and combinator suites were proposed to support generic programming with functional strategies. In the present paper, we provide a compact and matured reconstruction of functional strategies. We capture strategic polymorphism by just two primitive combinators. This is done without commitment to a specific functional language. We analyse the design space for implementational models of functional strategies. For completeness, we also provide an operational reference model for implementing functional strategies (in Haskell). We demonstrate the generality of our approach by reconstructing representative fragments of the Strafunski library for functional strategies.Comment: A preliminary version of this paper was presented at IFL 2002, and included in the informal preproceedings of the worksho

    Model Transformations in MT

    Get PDF
    Model transformations are recognised as a vital aspect of Model Driven Development,but current approaches cover only a small part of the possible spectrum. In this paper I present the MT model transformation which shows how a QVT-like language can be extended with novel pattern matching constructs, how tracing information can be automatically constructed and visualized, and how the transformed model is pruned of extraneous elements. As MT is implemented as a DSL within the Converge language, this paper also demonstrates how a general purpose language can be embedded in a model transformation language, and how DSL development can aid experimentation and exploration of new parts of the model transformation spectrum
    corecore