59 research outputs found

    Boxes Go Bananas: Encoding Higher-Order Abstract Syntax With Parametric Polymorphism (Extended Version)

    Get PDF
    Higher-order abstract syntax is a simple technique for implementing languages with functional programming. Object variables and binders are implemented by variables and binders in the host language. By using this technique, one can avoid implementing common and tricky routines dealing with variables, such as capture-avoiding substitution. However, despite the advantages this technique provides, it is not commonly used because it is difficult to write sound elimination forms (such as folds or catamorphisms) for higher-order abstract syntax. To fold over such a datatype, one must either simultaneously define an inverse operation (which may not exist) or show that all functions embedded in the datatype are parametric. In this paper, we show how first-class polymorphism can be used to guarantee the parametricity of functions embedded in higher-order abstract syntax. With this restriction, we implement a library of iteration operators over data-structures containing functionals. From this implementation, we derive fusion laws that functional programmers may use to reason about the iteration operator. Finally, we show how this use of parametric polymorphism corresponds to the Schürmann, Despeyroux and Pfenning method of enforcing parametricity through modal types. We do so by using this library to give a sound and complete encoding of their calculus into System Fω. This encoding can serve as a starting point for reasoning about higher-order structures in polymorphic languages

    Generalizing Parametricity Using Information Flow (Extended Version)

    Get PDF
    Run-time type analysis allows programmers to easily and concisely define operations based upon type structure, such as serialization, iterators, and structural equality. However, when types can be inspected at run time, nothing is secret. A module writer cannot use type abstraction to hide implementation details from clients: clients can determine the structure of these supposedly abstract data types. Furthermore, access control mechanisms do not help isolate the implementation of abstract datatypes from their clients. Buggy or malicious authorized modules may leak type information to unauthorized clients, so module implementors cannot reliably tell which parts of a program rely on their type definitions. Currently, module implementors rely on parametric polymorphism to provide integrity and confidentiality guarantees about their abstract datatypes. However, standard parametricity does not hold for languages with run-time type analysis; this paper shows how to generalize parametricity so that it does. The key is to augment the type system with annotations about information-flow. Implementors can then easily see which parts of a program depend on the chosen implementation by tracking the flow of dynamic type information

    Implementing Compositional Analysis Using Intersection Types With Expansion Variables

    Get PDF
    AbstractA program analysis is compositional when the analysis result for a particular program fragment is obtained solely from the results for its immediate subfragments via some composition operator. This means the subfragments can be analyzed independently in any order. Many commonly used program analysis techniques (in particular, most abstract interpretations and most uses of the Hindley/Milner type system) are not compositional and require the entire text of a program for sound and complete analysis.System I is a recent type system for the pure λ-calculus with intersection types and the new technology of expansion variables. System I supports compositional analysis because it has the principal typings property and an algorithm based on the new technology of β-unification has been developed that finds these principal typings. In addition, for each natural number k, typability in the rank-k restriction of System I is decidable, so a complete and terminating analysis algorithm exists for the rank-k restriction.This paper presents new understanding that has been gained from working with multiple implementations of System I and β-unification-based analysis algorithms. The previous literature on System I presented the type system in a way that helped in proving its more important theoretical properties, but was not as easy to follow as it could be. This paper provides a presentation of many aspects of System I that should be clearer as well as a discussion of important implementation issues

    Mechanized Metatheory for the Masses: The \u3cb\u3ePOPLMARK\u3c/b\u3e Challenge

    Get PDF
    How close are we to a world where every paper on programming languages is accompanied by an electronic appendix with machinechecked proofs? We propose an initial set of benchmarks for measuring progress in this area. Based on the metatheory of System F, a typed lambda-calculus with second-order polymorphism, subtyping, and records, these benchmarks embody many aspects of programming languages that are challenging to formalize: variable binding at both the term and type levels, syntactic forms with variable numbers of components (including binders), and proofs demanding complex induction principles. We hope that these benchmarks will help clarify the current state of the art, provide a basis for comparing competing technologies, and motivate further research

    Duchamp's Erotic Stereoscopic Exercises

    Get PDF
    This article explores certain links between medicine and art, with regard to their use of stereoscopy. I highlight a work by the artist Marcel Duchamp (the ready-made Stéréoscopie a la Main) and stereoscopic cards used in ophthalmic medicine. Both instances involve the drawing of graphic marks over previously existing stereoscopic cards. This similarity between Stéréoscopie a la Main and stereoscopic cards is echoed in the form of "stereoscopic exercises." Stereoscopic exercises were prescribed by doctors to be performed with the stereoscope as early as 1864. Stereoscopic cards were widely diffused in the 19th century, often promoted as "stay-at-home travel." It was over such kinds of materials that both Marcel Duchamp and doctors of ophthalmic medicine drew their graphic marks. I explore Duchamp's Stéréoscopie a la Main as a hypothetical basis for stereoscopic exercises of different types, proposing that this rectified ready-made is the locus for erotic stereoscopic exercises.Este artigo busca explorar certos elos entre a medicina e a arte por meio da estereoscopia. Destaca-se uma obra do artista Marcel Duchamp (o ready-made Stéréoscopie a la Main) e cartões estereoscópicos usados na oftalmologia. As duas instâncias envolvem o desenho de marcas gráficas sobre cartões estereoscópicos pré-existentes. A similaridade entre Stéréoscopie a la Main e os ditos cartões ecoa também na forma dos exercícios estereoscópicos. O cartão estereoscópico foi amplamente difundido na segunda metade do séc. XIX, frequentemente na forma da "viagem sem sair de casa." Foi sobre esse tipo de material que tanto médicos quanto Marcel Duchamp desenharam suas marcas. Explora-se a obra Stéréoscopie a la Main como um sítio hipotético para uma espécie de exercício, propondo que tal ready-made retificado seja um lugar para exercícios estereoscópicos eróticos

    A base-free synthetic route to anti-bimetallic lanthanide pentalene complexes

    Get PDF
    We report the synthesis and structural characterisation of three homobimetallic complexes featuring divalent lanthanide metals (Ln = Yb, Eu and Sm) bridged by the silylated pentalene ligand [1,4-{SiiPr3}2C8H4]2− (= Pn†). Magnetic measurements and cyclic voltammetry have been used to investigate the extent of intermetallic communication in these systems, in the context of molecular models for organolanthanide based conducting materials

    Proteomics Reveals Novel Drosophila Seminal Fluid Proteins Transferred at Mating

    Get PDF
    Across diverse taxa, seminal fluid proteins (Sfps) transferred at mating affect the reproductive success of both sexes. Such reproductive proteins often evolve under positive selection between species; because of this rapid divergence, Sfps are hypothesized to play a role in speciation by contributing to reproductive isolation between populations. In Drosophila, individual Sfps have been characterized and are known to alter male sperm competitive ability and female post-mating behavior, but a proteomic-scale view of the transferred Sfps has been missing. Here we describe a novel proteomic method that uses whole-organism isotopic labeling to detect transferred Sfps in mated female D. melanogaster. We identified 63 proteins, which were previously unknown to function in reproduction, and confirmed the transfer of dozens of predicted Sfps. Relative quantification of protein abundance revealed that several of these novel Sfps are abundant in seminal fluid. Positive selection and tandem gene duplication are the prevailing forces of Sfp evolution, and comparative proteomics with additional species revealed lineage-specific changes in seminal fluid content. We also report a proteomic-based gene discovery method that uncovered 19 previously unannotated genes in D. melanogaster. Our results demonstrate an experimental method to identify transferred proteins in any system that is amenable to isotopic labeling, and they underscore the power of combining proteomic and evolutionary analyses to shed light on the complex process of Drosophila reproduction

    Cause and Effect: Type Systems for Effects and Dependencies

    Get PDF
    Formal framework for reasoning about programs are important not only for automated tools but also for programmers. Type systems have proven an enormously popular framework for validating static analyses of programs, as well as for documenting their interfaces for programmers. However, most type systems used in practice today fail to capture many essential aspect of p behavior dependencie of programs The considerabl c i pas twenty years int developing that captu e information I pape examin compa contrast connec mbe o highly influentia p ototy ica system capturing dependencies Specifically w classi e typ system a onceive fo l canonical example o pendenc system system information-flow di moda systems c (co)monadi e fec dependenc discipline linear system p e- easonin abou state esou Finally als esen calculus provide insight possibili fo a unified account for all of these systems
    corecore