All Projects → fritzo → pomagma

fritzo / pomagma

Licence: other
An inference engine for extensional untyped λ-calculus

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects
CMake
9771 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to pomagma

gidti
Book: Gentle Introduction to Dependent Types with Idris
Stars: ✭ 70 (+366.67%)
Mutual labels:  lambda-calculus, theorem-proving
lambda-zero
A minimalist pure lazy functional programming language
Stars: ✭ 65 (+333.33%)
Mutual labels:  lambda-calculus
Formality Javascript
An implementation of the Formality language in JavaScript
Stars: ✭ 71 (+373.33%)
Mutual labels:  lambda-calculus
pyprover
Resolution theorem proving for predicate logic in pure Python.
Stars: ✭ 71 (+373.33%)
Mutual labels:  theorem-proving
Y Combinator For Non Programmers
🍱 Y Combinator for Non-programmers: A Wild Introduction to Computer Science
Stars: ✭ 109 (+626.67%)
Mutual labels:  lambda-calculus
HoloClean-Legacy-deprecated
A Machine Learning System for Data Enrichment.
Stars: ✭ 75 (+400%)
Mutual labels:  inference-engine
Mikrokosmos
(λ) Educational lambda calculus interpreter
Stars: ✭ 50 (+233.33%)
Mutual labels:  lambda-calculus
abella
An interactive theorem prover based on lambda-tree syntax
Stars: ✭ 81 (+440%)
Mutual labels:  lambda-calculus
rusty-razor
Razor is a tool for constructing finite models for first-order theories
Stars: ✭ 54 (+260%)
Mutual labels:  theorem-proving
Curryhoward
Automatic code generation for Scala functions and expressions via the Curry-Howard isomorphism
Stars: ✭ 229 (+1426.67%)
Mutual labels:  lambda-calculus
Elsa
Elsa is a lambda calculus evaluator
Stars: ✭ 135 (+800%)
Mutual labels:  lambda-calculus
Combinators Js
🐦 Some combinators
Stars: ✭ 114 (+660%)
Mutual labels:  lambda-calculus
BOHM1.1
Bologna Optimal Higher-Order Machine, Version 1.1
Stars: ✭ 45 (+200%)
Mutual labels:  lambda-calculus
Church
⛪️ Church Encoding in JS
Stars: ✭ 107 (+613.33%)
Mutual labels:  lambda-calculus
planer
Powerful Light Artificial NEuRon inference framework for CNN
Stars: ✭ 52 (+246.67%)
Mutual labels:  inference-engine
Lambda
Fun with λ calculus!
Stars: ✭ 65 (+333.33%)
Mutual labels:  lambda-calculus
StepULC
Efficient and single-steppable ULC evaluation algorithm
Stars: ✭ 15 (+0%)
Mutual labels:  lambda-calculus
lambda-notebook
Lambda Notebook: Formal Semantics in Jupyter
Stars: ✭ 16 (+6.67%)
Mutual labels:  lambda-calculus
Kind
A modern proof language
Stars: ✭ 2,075 (+13733.33%)
Mutual labels:  lambda-calculus
js-church-encoding
Church Encoding Implementation in JavaScript
Stars: ✭ 33 (+120%)
Mutual labels:  lambda-calculus

Pomagma

Build Status PyPI Version

Pomagma is an inference engine for extensional untyped λ-join-calculus, a simple model of computation in which nondeterminism gives rise to an elegant gradual type system.

Pomagma can:

  • simplify code fragments expressed in λ-join-calculus
  • validate codebases of programs and assertions
  • solve systems of inequalities and horn clauses
  • synthesize code from sketches and inequality constraints

Pomagma's base theory is being formally verified in the Hstar project.

Pomagma's architecture follows a client-server model, where a Python client library performs high-level syntactic tasks, and a shared C++ database server performs low-level inference work.

Installing

The server targets Ubuntu 14.04 and 12.04, and installs in a python virtualenv.

git clone https://github.com/fritzo/pomagma
cd pomagma
. install.sh
make small-test     # takes ~5 CPU minutes
make test           # takes ~1 CPU hour

The client library supports Python 2.7.

pip install pomagma

Quick Start

Start a local analysis server with the tiny pre-built atlas

pomagma analyze             # starts server, Ctrl-C to quit

Then in another terminal, start an interactive python client session

$ pomagma connect           # starts a client session, Ctrl-D to quit
>>> simplify(['APP I I'])
[I]
>>> validate(['I'])
[{'is_bot': False, 'is_top': False}]
>>> solve('x', 'EQUAL x APP x x', max_solutions=4)
['I', 'BOT', 'TOP', 'V']
>>> validate_facts(['EQUAL x TOP', 'LESS x BOT'])
False

Alternatively, connect using the Python client library

python
from pomagma import analyst
with analyst.connect() as db:
    print db.simplify(["APP I I"])
    print db.validate(["I"])
    print db.solve('x', 'EQUAL x APP x x', max_solutions=4)
    print db.validate_facts(['EQUAL x TOP', 'LESS x BOT'])

Get an Atlas

Pomagma reasons about large programs by approximately locating code fragments in an atlas of 103-105 basic programs. The more basic programs in an atlas, the more accurate pomagma's analysis will be. Pomagma ships with a tiny pre-built atlas of ~2000 basic programs.

To get a large pre-built atlas, put your AWS credentials in the environment and

export AWS_ACCESS_KEY_ID=...        # put your id here
export AWS_SECRET_ACCESS_KEY=...    # put your hey here
pomagma pull                        # downloads latest atlas from S3

To start building a custom atlas from scratch

pomagma make max_size=10000         # kill and restart at any time

Pomagma is parallelized and needs lots of memory to build a large atlas.

Atlas Size Compute Time Memory Space Storage Space
1 000 atoms ~1 CPU hour ~10MB ~1MB
10 000 atoms ~1 CPU week ~1GB ~100MB
100 000 atoms ~1 CPU year ~100GB ~10GB

License

Copyright (c) 2005-2017 Fritz Obermeyer.
Pomagma is licensed under the Apache 2.0 License.

Pomagma ships with the Google Farmhash library, licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].