9 research outputs found

    Implementing Type Theory in Higher Order Constraint Logic Programming

    Get PDF
    International audienceIn this paper we are interested in high-level programming languages to implement the core components of an interactive theorem prover for a dependently typed language: the kernel — responsible for type-checking closed terms — and the elaborator — that manipulates terms with holes or, equivalently, partial proof terms. In the first part of the paper we confirm that λProlog, the language developed by Miller and Nadathur since the 80s, is extremely suitable for implementing the kernel, even when efficient techniques like reduction machines are employed. In the second part of the paper we turn our attention to the elaborator and we observe that the eager generative semantics inherited by Prolog makes it impossible to reason by induction over terms containing metavariables. We also conclude that the minimal extension to λProlog that allows to do so is the possibility to delay inductive predicates over flexible terms, turning them into (set of) constraints to be propagated according to user provided constraint propagation rules. Therefore we propose extensions to λProlog to declare and manipulate higher order constraints, and we implement the proposed extensions in the ELPI system. Our test case is the implementation of an elaborator for a type theory as a CLP extension to a kernel written in plain λProlog

    Implementazione in un linguaggio logico con vincoli di ordine superiore della type inference di Haskell

    Get PDF
    Implementazione in ELPI, un linguaggio logico con vincoli di ordine superiore, dell'algoritmo di type inference di Haskell. ELPI è un'estensione con vincoli di lambda Prolog. Utilizzando lambda Prolog risulta impossibile implementare la type inference di Haskell. Si è reso dunque necessario l'utilizzo di ELPI, più espressivo (non nel senso di Turing completezza) di lambda Prolog. La presente trattazione ha una duplice finalità. La prima consiste nel dimostrare che le estensioni a lambda Prolog presenti in ELPI permettono di risolvere problemi non risolvibili in lambda Prolog. La seconda, non ancora implementata ma lasciata agli sviluppi futuri, prevede di fare del mio lavoro uno strumento di prova per testare, implementare e studiare nuove estensioni al meccanismo delle type class di Haskell. Infatti, essendo ELPI un linguaggio di più alto livello e più semplice (grazie alle features del linguaggio) rispetto ad Haskell, aggiungere estensioni al meccanismo base delle type class dovrebbe risultare banale (in confronto alla complessità di eseguire tale operazione in Haskell)

    Sviluppo di un interactive theorem prover in ELPI

    Get PDF
    In questo elaborato è discusso l'utilizzo del linguaggio Lambda Prolog, con interprete ELPI, per lo sviluppo di dimostratori interattivi. Nel primo capitolo viene introdotto Lambda Prolog, sono fornite indicazioni storiche sull'interactive theorem proving e descritto cosa ci si aspetta da un interactive theorem prover basato sull'isomorfismo di Curry-Howard. Le estensioni fornite da ELPI sono analizzate rispetto alla possibilità di facilitare l'implementazione di un dimostratore interattivo. Nel secondo capitolo è introdotta Minimalist Type Theory, analizzato il kernel implementato e su cui è stato costruito il lavoro sviluppato, con una trattazione dell'implementazione di un elaboratore e di un dimostratore interattivo. Per concludere, vengono analizzati pro e contro della soluzione proposta e i suoi possibili sviluppi futuri

    Implementing type theory in higher order constraint logic programming

    No full text
    In this paper, we are interested in high-level programming languages to implement the core components of an interactive theorem prover for a dependently typed language: the kernel - responsible for type-checking closed terms - and the elaborator - that manipulates open terms, that is terms containing unresolved unification variables.In this paper, we confirm that rolog, the language developed by Miller and Nadathur since the 80s, is extremely suitable for implementing the kernel. Indeed, we easily obtain a type checker for the Calculus of Inductive Constructions (CIC). Even more, we do so in an incremental way by escalating a checker for a pure type system to the full CIC.We then turn our attention to the elaborator with the objective to obtain a simple implementation thanks to the features of the programming language. In particular, we want to use Prolog's unification variables to model the object language ones. In this way, scope checking, carrying of assignments and occur checking are handled by the programming language.We observe that the eager generative semantics inherited from Prolog clashes with this plan. We propose an extension to Prolog that allows to control the generative semantics, suspend goals over flexible terms turning them into constraints, and finally manipulate these constraints at the meta-meta level via constraint handling rules.We implement the proposed language extension in the Embedded Lambda Prolog Interpreter system and we discuss how it can be used to extend the kernel into an elaborator for CIC

    Unification via Explicit Substitutions: The Case of Higher-Order Patterns

    Get PDF
    In [6] we have proposed a general higher-order unification method using a theory of explicit substitutions and we have proved its completeness. In this paper, we investigate the case of higher-order patterns as introduced by Miller. We show that our general algorithm specializes in a very convenient way to patterns. We also sketch an efficient implementation of the abstract algorithm and its generalization to constraint simplification, which has yielded good experimental results at the core of a higher-order constraint logic programming language

    Mode and Termination Checking for Higher-Order Logic Programs

    No full text
    . We consider how mode (such as input and output) and termination properties of typed higher-order constraint logic programming languages may be declared and checked effectively. The systems that we present have been validated through an implementation and numerous case studies. 1 Introduction Just like other paradigms logic programming benefits tremendously from types. Perhaps most importantly, types allow the early detection of errors when a program is checked against a type specification. With some notable exceptions most type systems proposed for logic programming languages to date (see [18]) are concerned with the declarative semantics of programs, for example, in terms of many-sorted, order-sorted, or higher-order logic. Operational properties of logic programs which are vital for their correctness can thus neither be expressed nor checked and errors will remain undetected. In this paper we consider how the declaration and checking of mode (such as input and output) and termina..
    corecore