• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language Standard ML
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An proof refinement logic for computational type theory. Inspired by Nuprl. [For up-to-date development, see JonPRL's successor, RedPRL: https://github.com/redprl/sml-redprl]

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 update --init --recursive

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.

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.

abstract form concrete form description
unit() unit The unit type
<>() <> The trivial inhabitant of unit
fun(0;1) (x:A) B, A -> B The dependent function type
lam(1) lam(x.E) The lambda abstraction
ap(0;0) M N Function application
isect(0;1) {x:A} B, A => B The family intersection type
prod(0;1) (x:A) * B, A * B The dependent pair type
pair(0;0) <M,N> The pair operator
spread(0;2) spread(M; x.y.E) Pattern matching for pairs
subset(0;1) `{x:A B}`
plus(0;0) A + B The disjoint union type
inl(0) inl(M) The left union introduction form
inr(0) inr(M) The right union introduction form
decide(0;1;1) decide(M; l.E; r.F) Pattern matching for disjoint unions
void() void The empty type
=(0;0;0) =(M;N;A) The equality type (M,N are equal at type A)
member(0;0) member(M;A) The membership type (M is a member of A)
so_apply(0;0) F[x] Application for second order variables

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 (written using brackets, F[x]).

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

Operator ex_uni : (0;1).

[ex_uni(T;x.P[x])] =def= [(x:T) * P[x] * {y:T} 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.

More Repositories

1

Githood

A minimal Github client for iOS. No longer actively developed.
Objective-C
97
star
2

dreamtt

A pedagogic implementation of abstract bidirectional elaboration for dependent type theory.
OCaml
83
star
3

forest

My mathematical Zettelkasten, created using forester.
Shell
78
star
4

agda-calf

A cost-aware logical framework, embedded in Agda.
Agda
55
star
5

math

A mini-book on category theory. Superseded by https://github.com/jonsterling/forest
TeX
51
star
6

ocaml-forester

Mirror of ocaml-forester
OCaml
40
star
7

Tasky

A Taskwarrior client. This was created to fill my own need: feel free to modify it! If it looks really ugly, you probably have your terminal configured wrong.
Python
31
star
8

Lens.hpp

Functional Lenses in C++
C++
21
star
9

coq-guarded-computational-type-theory

Coq
20
star
10

latex-dieudonne

A LaTeX package to reproduce (an enhanced version of) the numbered paragraph style from classic French mathematics books.
TeX
19
star
11

lcf-sequent-calculus-example

A self-contained implementation of forward and backward inference for intuitionistic propositional logic
TeX
18
star
12

RAFExamples

An example of ReactiveFormlets use in the MVVM style
Objective-C
18
star
13

coq-domains

Coq
18
star
14

agda-synthetic-domain-theory

Agda
17
star
15

tt

secret project
OCaml
17
star
16

agda-stc

Hacking synthetic Tait computability into Agda. Example: canonicity for MLTT.
Agda
16
star
17

hs-abt

Type safe abstract binding trees for Haskell, using Vinyl
Haskell
16
star
18

sml-modernized-algol

Harper's Modernized ALGOL in SML using multi-sorted nominal abstract binding trees
Standard ML
15
star
19

agda-zipper-machine

An abstract machine using indexed containers and their zippers
Agda
14
star
20

sml-logical-framework

Jason Reed's Tiny LF, and some experiments in higher-order proof refinement logics using Jon Sterling Thought
Standard ML
14
star
21

constructive-sheaf-semantics

I'm putting Palmgren's Constructive Sheaf Semantics into Agda. Defines sheaves via Grothendieck pretopologies.
Agda
13
star
22

TaskWarriorWeb

A quick & dirty Yesod-based local web interface to TaskWarrior
Haskell
12
star
23

agda-effectful-forcing

Agda formalization of the paper, "Higher-Order Functions and Brouwer's Thesis". Deduces a Brouwer ordinal from a function ((nat -> nat) -> nat) in System T.
Agda
12
star
24

TT-Reflection

An experimental type theory with scoped equality reflection, and non-arbitrary proof search. This is basically a pared down version of Andromeda/Brazil, but with untyped reduction and a more Nuprl-like feel. Computational content of proofs is got via a realizability-based extraction. (Note: substitution is unsafe here, not because of a problem with the theory, but because I didn't understand how Bound works sadly.)
Haskell
12
star
25

topos-theory-notes

TeX
10
star
26

lean4-sgdt

Experiments with synthetic guarded domain theory in Lean 4.
Lean
9
star
27

itt-bidirectional

A bidirectional type checker for intensional constructive type theory (with thanks to Stephanie Weirich).
Haskell
8
star
28

math-translations

Hypertext translations of some classic mathematical papers into English
TeX
8
star
29

agda-brouwerian-mathematics

some "modernized" brouwerian mathematics, inspired by Hancock, Ghani & Pattinson
Agda
8
star
30

agda-abt

Abstract binding trees in Agda
Agda
7
star
31

lecture-notes

TeX
7
star
32

effectful-typesetting

A case-study in effects-and-handlers for bubbling out configurations from the interior of programs that typeset text.
OCaml
6
star
33

brouwer-translations

translations of brouwer's writings; corrections from native speakers welcome!
TeX
6
star
34

mathematical-notebook

Read at your own risk! Not everything in here is guaranteed to be correct.
TeX
6
star
35

agda-bar-induction

Agda
5
star
36

coq-algebra

Coq
5
star
37

coq-sgdt

Coq
5
star
38

Agda-Sheaves

Sheaves in Agda (will be superseded by https://github.com/jonsterling/constructive-sheaf-semantics which has sheaves on a site)
Agda
5
star
39

agda-nominal-sets

Agda
5
star
40

coq-meaning-explanation

Coq
5
star
41

sml-pronominal-ml

An experiment with nominal features in a programming language
Standard ML
5
star
42

hs-monad-open

Open-ended computation for when you need it (open recursion)
Haskell
5
star
43

twelf-nbe

normalization by evaluation for MLTT in twelf
4
star
44

ocaml-modular-typechecking

Modular type checking using open types
OCaml
4
star
45

guarded-theories

Coq
4
star
46

sml-spreads

A library for Brouwerian data structures (spreads, fans, choice sequences)
Standard ML
4
star
47

purescript-lcf

A general-purpose library for LCF+validations refiners
PureScript
4
star
48

stlc-type-inference

TeX
4
star
49

bar-induction-slides

TeX
3
star
50

racket-grit

Grit: the kernel around which a PRL forms
Racket
3
star
51

agda-directed-plump-ordering

Agda
3
star
52

agda-sheaf-semantics

here we go again
Agda
3
star
53

Luitzen

A possibly-wrong implementation of OTT (a fork of pi-forall)
Haskell
3
star
54

ocaml-abt

(intrinsically typed) ABTs for OCaml
OCaml
3
star
55

lean-syntax

just learning to use lean
Lean
3
star
56

tt-singletons

experiments with singleton types & identity types in type theory
Haskell
3
star
57

twelf-itt

modular development of intensional type theory in twelf
3
star
58

latex-diagrams

An extension of Paul Taylor's excellent diagrams package with an improved default arrow head, using METAFONT
TeX
3
star
59

sml-elaborating-typechecker

An example of how to use LCF + validations to type check and normalize lambda terms (via cut admissibility)
Standard ML
3
star
60

latex3-jmsdelim

TeX
3
star
61

Tmux-Haskell

A DSL for scripting Tmux in Haskell. [BTW, this doesn't really work. Sorry!]
Haskell
3
star
62

coq-synthetic-realizability

Some experiments
Coq
3
star
63

coq-algebra-experiments

Formalizing some basic commutative algebra in Coq in order to procrastinate on my thesis proposal and paper reviews.
Coq
3
star
64

hs-aws-dynamodb-streams

Bindings for DynamoDb Streams
Haskell
3
star
65

Coq-Up

A tarpit in Coq
Coq
3
star
66

purescript-abt

Abstract binding trees for purescript
PureScript
3
star
67

bibtex-references

TeX
3
star
68

choice-sequences

Agda
2
star
69

twelf-cmcp

ITT 1979 in Twelf (ร  la Constructive Mathematics and Computer Programming)
TeX
2
star
70

sml-ifol-completeness

intuitionistic completeness of first order logic ร  la Constable & Bickford
Standard ML
2
star
71

Lithos

A processor for Literate Haskell, inspired by Docco. Uses Pandoc, Highlighting-Kate, BlazeHtml and Shakespearean templates.
Haskell
2
star
72

coq-presheaf-cwf

Makefile
2
star
73

agda-cubical-sets

Agda
2
star
74

sml-open-ended

open-ended data types in standard ml (i.e. the ultimate benign effect)
Standard ML
2
star
75

.TeXmacs-progs

My TeXmacs configuration files
Scheme
2
star
76

CCG-Framework

A framework for testing multi-modal CCG constructions
2
star
77

agda-groupoids

Groupoids in Agda with no postulates (by Darin Morrison)
Agda
2
star
78

sml-kripke-schema

Kripke's Schema as a computational effect
Standard ML
2
star
79

systems-study-notes

some very sad notes for a very sad class
TeX
2
star
80

sml-ipl-completeness

Constructive witness to completeness of realizability interpretation for IPL, using exceptions. Based on an idea from Mark Bickford and Bob Constable
Standard ML
2
star
81

sml-abt

This is the CMU ABT library, with some minor improvements. DEPRECATED in favor of https://github.com/JonPRL/sml-typed-abts
Standard ML
2
star
82

higher-dimensional-pers

experiments with higher dimensional partial equivalence relations for mixing exact equality with fibrant equality
Agda
1
star
83

agda-meaning-explanations

Demonstration of meaning explanations in agda
Agda
1
star
84

LaTeX-Macros

My personal macros
1
star
85

coq-cbpv

Makefile
1
star
86

sml-abt-parser

A parser library for ABTs based on parcom. DEPRECATED in favor of https://github.com/jonsterling/sml-typed-abts
Standard ML
1
star
87

Diaconescu-TT

An Agda proof of Diaconescu's Theorem for Constructive Type Theory using Setoids
Agda
1
star
88

latex-ebproof-rules

A package to support combining ebproof with mathpartir
TeX
1
star
89

burnt-offering-secrets

HTML
1
star
90

sml-nominal-sets

Standard ML
1
star
91

agda-mltt-forcing

a model of MLTT over the Baire spread
Agda
1
star
92

c0ns

An experimental nameserver written in C0
TeX
1
star
93

sml-open-abt

An open-ended operator structure for abts
Standard ML
1
star
94

singletons

Adding GHC type literal promotion to http://www.cis.upenn.edu/~eir/packages/singletons/. There are trade-offs.
Haskell
1
star
95

music

LilyPond
1
star
96

lambdapi

An in-progress port of LambdaPi to Standard ML
Standard ML
1
star
97

sml-zipper

Huet's Zipper
Standard ML
1
star
98

ETT-Lite

A fork of Stephanie Weirich's pi-forall, which does away with the parametric quantifier (not my research question) and adds equality reflection
Haskell
1
star