Code Monkey home page Code Monkey logo

jonprl's Introduction

JonPRL is a proof refinement logic in the sense of λ-PRL or Nuprl; JonPRL inherits its computational type theory from Constable, Bates, Harper, Allen, Bickford, Howe, Smith and many other names. Computational Type Theory is based on a meaning explanation similar to the ones which Martin-Löf introduced in 1979, to which I have written a self-contained introduction, Type Theory and its Meaning Explanations.

Discussion and Questions

There is an IRC channel on freenode at #jonprl.

Building & Installing JonPRL

JonPRL uses SML/NJ's CM for its build. First make sure you have SML/NJ set up properly. Then, install JonPRL's dependencies:

git submodule init
git submodule update

Then, JonPRL may be built using its Makefile:

make smlnj
make test

This puts a binary in ./bin/jonprl. Optionally, you may install JonPRL globally using:

sudo make install

Running JonPRL

To run JonPRL, simply direct it at your development:

jonprl example/test.jonprl

You may specify as many files as you like in this command; they will be refined in order, in case of any dependencies.

Emacs Mode

Optionally, you may install the JonPRL Mode for Emacs.

If you use pretty-mode, then you may install the following patterns:

(pretty-add-keywords
  'jonprl-mode
  '(("\\\[" . "")
    ("\\\]" . "")
    ("<" . "")
    (">" . "")
    ("<>" . "")
    ("\\<\\(=def=\\)\\>" . "")
    ))

screenshot of jonprl-mode

Basic Syntax

JonPRL has a two-level syntax. There is the syntax of terms in the underlying lambda calculus (the object language) and the syntax of tactics and definitions in the metalanguage. Terms from the underlying lambda calculus are embedded into the metalanguage using brackets ([ and ]). When referring to names from the object language in the metalanguage, they are quoted in angle brackets (< and >).

The syntax of the object language represents all binders in a consistent manner. The variables to be bound in a subterm are written before it with a dot. For example, the identity function is written λ(x.x) where the first x indicates the bound name and the second refers back to it, and the first projection of a pair P is written spread(P; x.y.x). The semicolon separates arguments to spread.

Top-level declarations

JonPRL provides four top-level declarations:

  • Operator gives the binding structure of a new operator.
  • =def= defines the meaning of an operator in terms of the existing operators.
  • Theorem declares a theorem, and allows it to be proven.
  • Tactic defines a tactic in terms of the built-in tactics.

Built-in operators

Together with the syntax for binding trees, the built-in operators of JonPRL constitute the core type theory, in combination with the rules for CTT which are built into JonPRL's refiner. In this section, several of the operators is presented together with its arity and a brief informal description. An arity is a list of the valences of an operator's subterms; valence is the number of variables to bind.

Unit

The unit type is written unit() and its trivial inhabitant is written <>().

Functions

Functions are introduced with λ(1) and eliminated with ap(0;0) (application). Π(0;1) gives the type of functions.

Pairs

Pairs are introduced with pair(0;0) and eliminated with spread(0;2). The type of pairs is given by Σ(0;1).

Sums

Sums are introduced with inl(0) and inr(0). They are eliminated with decide(0;1;1). The type of sums is built with +(0;0).

The empty type

The empty type is built with void().

Equality

Equality is written =(0;0;0), where the first two arguments are the equal terms and the third argument is the type in which they are equal.

Second-order variables

Unlike some other implementations of type theory that use the same syntax for function application and filling in second-order variables, JonPRL's second-order variables must be applied using the so_apply(0;0) operator.

As an example, unique existence might be defined as follows:

Operator ex_uni : (0;1).

[ex_uni(T;P)] =def= [Σ(T; x. Σ(so_apply(P;x);_.∀(T;y. Π(so_apply(P;y); _.=(x;y;T)))))].

Note that P is applied to x and y using so_apply rather than ap, which is reserved for function application.

Computational Equivalence

The elements of base() are all closed terms. Their equality is ceq(0;0), which denotes Howe's computational equivalence. Two terms are computationally equivalent if they both diverge or if they run to equivalent results. Computational equivalence is a congruence, which means that one can also prove that two terms are computationally equivalent if their subterms are computationally equivalent.

TODO

The following operators exist but are not yet documented: , subset, .

jonprl's People

Contributors

jonsterling avatar jozefg avatar david-christiansen avatar freebroccolo avatar joelburget avatar thsutton avatar

Watchers

 avatar James Cloos avatar  avatar

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.