Giter Club home page Giter Club logo

muprl's Introduction

MuPRL

MuPRL is a small, mainly instructional, proof assistant in the style of NuPRL. For a good introduction to Computational Type Theory, see this.

Examples

Let's try to prove a very simple tautology: "for every proposition a, a implies a".

Theorem i : (a:universe 0) -> (x:a) -> a {
    id
}

If we try running this, we will get the following message:

Error:
    Unproved Subgoals:   ⊢ (a:universe 0) -> (x:a) -> a

To start, we are going to need to add (a:universe 0) and (x:a) as hypotheses. For this we can use the fun/intro rule.

Theorem i : (a:universe 0) -> (x:a) -> a {
    rule fun/intro
}

This generates the following subgoals.

Unproved Subgoals:  a:universe 0 ⊢ (x:a) -> a
                        ⊢ universe 0 = universe 0 in universe 1

The first one should be pretty self explanitory, but the second one is a bit more bizzare. It essentially is asking us to show that universe 0 is a valid proposition.

Both of these subgoals are going to need different rules applied to them. To do this, we can use [] to specify which goal we want to apply a rule to, and ; to sequence.

Theorem i : (a:universe 0) -> (x:a) -> a {
    rule fun/intro; [rule fun/intro, rule universe/eqtype]
}
Unproved Subgoals:  a:universe 0, x:a ⊢ a
                    a:universe 0 ⊢ a = a in universe 0

The 1st goal should be pretty easy to prove, as it is already in our hypotheses! As for the second one, we can use eq/intro to prove it.

Theorem i : (a:universe 0) -> (x:a) -> a {
    rule fun/intro; [rule fun/intro; [rule assumption, rule eq/intro], rule universe/eqtype]
}

If we run this, we get the output \a. \x. x, which is a program that meets our specification! This means that our proof is complete. However, this seems like quite a lot of busy work for what should be a very simple proof. To remedy this, we can use some more complicated tactics. For starters, we can use the intro tactic to automatically select the proper introduction rule for us.

Theorem i : (a:universe 0) -> (x:a) -> a {
    intro; [intro; [rule assumption, intro], rule universe/eqtype]
}

Also, we seem to be applying the intro rule quite a few times in a row, so we can use the * tactic to run the intro tactic repeatedly until it fails.

Theorem i : (a:universe 0) -> (x:a) -> a {
    *intro; [rule assumption, rule universe/eqtype]
}

Building

stack build && stack exec muprl

muprl's People

Contributors

totbwf 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hermetique

muprl's Issues

Inverse Semigroupoid Semantics

The semantics for NuPRL's types are based off of Partial Equivalence Relations, where a : A if a = a in A under the associated PER. In short, the types form partial setoids. However, this discards a lot of very interesting information, namely, why things are equal.

With this in mind, we can see that NuPRL's types are really just h-sets/0-truncated. However, Groupoids aren't quite the model we are looking for, as they miss out on the Partial portion of PER. Taking this into consideration, we can see that types form Inverse Semigroupoids over the set of (closed) terms.

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.