Reasoning about functional programs by combining interactive and automatic proofs

Sicard-Ramírez, Andrés

Supervisor(es): Bove, Ana - Dybjer, Peter

Resumen:

We propose a new approach to computer-assisted verification of lazy functional programs where functions can be defined by general recursion. We work in first-order theories of functional programs which are obtained by translating Dybjer's programming logic (Dybjer, P. [1985]. Program Verification in a Logical Theory of Constructions. In: Functional Programming Languages and Computer Architecture. Ed. by Jouannaud, J. P. Vol. 201. Lecture Notes in Computer Science. Springer, pp. 334–349) into a first-order theory, and by extending this programming logic with new (co-)inductive predicates. Rather than building a special purpose system, we formalise our theories in Agda, a proof assistant for dependent type theory which can be used as a generic theorem prover. Agda provides support for interactive reasoning by representing first-order theories using the propositions-as-types principle. Further support is provided by off-the-shelf automatic theorem provers for first-order-logic called by a Haskell program that translates our Agda representations of first-order formulae into the TPTP language understood by the provers. We show some examples where we combine interactive and automatic reasoning, covering both proofs by induction and co-induction. The examples include functions defined by structural recursion, simple general recursion, nested recursion, higher-order recursion, guarded and unguarded co-recursion.


Proponemos un nuevo enfoque a la verificación asistida por computador de programas funcionales perezosos, en los cuales las funciones pueden ser definidas por recursión general. Empleamos teorías de primer orden para programas funcionales las cuales fueron obtenidas de traducir la lógica para la programación de Dybjer (Dybjer, P. [1985]. Program Verification in a Logical Theory of Constructions. En: Functional Programming Languages and Computer Architecture. Ed. by Jouannaud, J.-P. Vol. 201. Lecture Notes in Computer Science. Springer, págs. 334–349) a una teoría de primer orden, y de extender esta lógica para la programación con nuevos predicados (co-)inductivos. En lugar de construir un sistema para formalizar nuestras teorías, formalizamos éstas en Agda, un asistente de pruebas para teoría de tipos dependientes que puede ser usado como un demostrador de teoremas genérico. Agda proporciona soporte para el razonamiento interactivo representando las teorías de primer orden mediante el principio de propositions-as-types. Se obtiene soporte adicional mediante demostradores automáticos de teoremas genéricos para lógica de primer orden, los cuales son llamados por un programa desarrollado en Haskell, que traslada nuestra representación en Agda de las fórmulas de primer orden al lenguaje TPTP entendido por los demostradores automáticos. Mostramos ejemplos de combinación de razonamiento interactivo y automático en pruebas por inducción y por co-inducción. Nuestros ejemplos incluyen funciones definidas por recursión estructural, recursión general simple, recursión anidada, recursión de orden superior y co-recursión.


Detalles Bibliográficos
2015
Demostración automática de teoremas
Demostración interactiva de teoremas
Evaluación perezosa
Teoría de tipos
Lenguajes totales
Recursión general
Teorías de primer orden
Verificación de programas funcionales
Automatic proofs
First-order theories
Functional program correctness
General recursion
Interactive proofs
Lazy evaluation
Total languages
Type theory
Inglés
Universidad de la República
COLIBRI
http://hdl.handle.net/20.500.12008/4715
Acceso abierto
Licencia Creative Commons Atribución – No Comercial – Sin Derivadas (CC BY-NC-ND 4.0)
Resumen:
Sumario:We propose a new approach to computer-assisted verification of lazy functional programs where functions can be defined by general recursion. We work in first-order theories of functional programs which are obtained by translating Dybjer's programming logic (Dybjer, P. [1985]. Program Verification in a Logical Theory of Constructions. In: Functional Programming Languages and Computer Architecture. Ed. by Jouannaud, J. P. Vol. 201. Lecture Notes in Computer Science. Springer, pp. 334–349) into a first-order theory, and by extending this programming logic with new (co-)inductive predicates. Rather than building a special purpose system, we formalise our theories in Agda, a proof assistant for dependent type theory which can be used as a generic theorem prover. Agda provides support for interactive reasoning by representing first-order theories using the propositions-as-types principle. Further support is provided by off-the-shelf automatic theorem provers for first-order-logic called by a Haskell program that translates our Agda representations of first-order formulae into the TPTP language understood by the provers. We show some examples where we combine interactive and automatic reasoning, covering both proofs by induction and co-induction. The examples include functions defined by structural recursion, simple general recursion, nested recursion, higher-order recursion, guarded and unguarded co-recursion.