Git Product home page Git Product logo

ptarau / typesandproofs Goto Github PK

View Code? Open in Web Editor NEW
29.0 1.0 3.0 4.01 MB

Type inference algorithms and intuitionistic propositional theorem provers solving type inhabitation problems

License: Apache License 2.0

Prolog 100.00% Shell 0.01%
intuitionistic-logic theorem-prover type-inference curry-howard-isomorphism prolog lambda-terms random-binary-tree random-set-partition tautology-checking de-bruijn-notation

typesandproofs's Introduction

TypesAndProofs:

Type inference algorithms and intuitionistic propositional theorem provers solving type inhabitation problems. Combinatorial and random testers for the provers and type inferencers.

Type

$ go

or

swipl -s tp.pro

and then something like

?- bprove(a->b->a).
true.
?- bprove((a->b)->a).
false.

See a lot of examples of use in file tester.pro Generic benchmarking code is in bm.pro.

Given the Curry-Howard isomorphism, solving the type inhabitation problem is equivalent to finding propositional implicational intuitionistic tautology proofs.

These tools implement Prolog-based algorithms on the two sides of the Curry-Howard isomorphism, including combinatorial and random testers, centered around:

  • generating all candidate type expressions
  • generating all simple types
  • generating random candidate type expressions
  • generating random simple types

Some theory background needed for grasping what they do:

  • elements of sequent calculus and natural deduction
  • type inference algorithms for lambda terms
  • normal forms of lambda terms
  • combinatorial generation of trees, set partitions
  • random set-partition generation with urn-algorithms
  • random term generation with Boltzmann samplers
  • Gentzen's LJ calculus
  • Vorobiev-Hudelmaier-Dyckhoff's LJT calculus
  • Glivenko's double negation translation
  • Fitting's classical tautology checker
  • de Bruijn notation for lambda terms
  • beta reduction with de Bruijn indices

The provers to be tested and compared are:

  • Dyckchoff's program, specialized to implications
  • provers derived from the LJT calculus, directly
  • provers using Horn clause translations of implicational formulas
  • classical Provers, via Glivenko's translation
  • full intuitionistic propositional provers

The programs are tested with SWI Prolog 7.7.12.

Except for those using SWI-Prolog's multi-threading the code, the provers and the testers are likely to run on most Prologs.

This work-in-progress paper documents some key components of this code repository.

For comparing with other provers, we have ported the propositional subset of the ILTP library to SWI-Prolog and uniformized notation of some third party provers.

Try:

?-load_probs1. % our prover
?-load_probs2.
...
?-load_probsN.

for their respective performance.

So far, our faprove/1 and ff_prove/1 full propositional IL provers are the only ones passing all correctness tests as well as avoidance of stack overflow errors. All provers can be tested at various timout levels by changing max_time/1 in file tester.pro

typesandproofs's People

Contributors

ptarau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

typesandproofs's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.