Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
An inference engine for extensional untyped λ-calculus
C++ Python CMake JavaScript Other
branch: master

README.md

Build Status Code Quality PyPI Version NPM Version NPM Dependencies

Pomagma

Pomagma is an inference engine for extensional untyped λ-calculus. Pomagma's server provides code analysis services including:

  • simplification of code fragments
  • validation of entire codebases
  • search / code completion / program refinement

Pomagma has client libraries in python and node.js, and powers the Puddle reactive coding environment. The correctness of Pomagma's theory is being verified in the Hstar project.

Documentation

Installing

The server targets Ubuntu 12.04 and 14.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

Client libraries support Python 2.7 and Node.js.

pip install pomagma
npm install pomagma

Quick Start

Start a local analysis server with the tiny default atlas

python -m pomagma analyze       # starts server, Ctrl-C to quit

Query the server using the python client

python
from pomagma import analyst
with analyst.connect() as db:
    print db.simplify(["APP I I"])      # prints [I]
    print db.validate(["I"])            # prints [{"is_bot": False, "is_top": False}]

or the Node.js client

nodejs
var analyst = require("pomagma").analyst;
var db = analyst.connect();
console.log(db.simplify(["APP I I"]));  // prints [I]
console.log(db.validate(["I"]));        // prints [{"is_bot": false, "is_top": false}]
db.close();

Build an Atlas to power analysis

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 default atlas of ~2000 basic programs.

Start building a bigger atlas

python -m 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 uncompressed
10 000 atoms ~1 CPU week ~1GB ~100MB uncompressed
100 000 atoms ~5 CPU years ~100GB ~10GB uncompressed

License

Copyright 2005-2015 Fritz Obermeyer.
All code is licensed under the MIT license unless otherwise noted.

Something went wrong with that request. Please try again.