GithubHelp home page GithubHelp logo

chihyang / perpl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from diprism/perpl

0.0 0.0 0.0 937 KB

The PERPL Compiler

License: MIT License

Shell 2.04% Perl 1.76% Emacs Lisp 0.24% Haskell 93.40% TeX 1.86% Nix 0.06% Makefile 0.17% JetBrains MPS 0.46%

perpl's Introduction

The PERPL Compiler

PERPL stands for Probabilistic Exact Recursive Programming Language. Unlike many general-purpose PPLs, PERPL performs exact inference, via factor graph grammars. And unlike other PPLs that do support exact inference, PERPL can express unbounded recursive calls and (with some restrictions) recursive data structures. For example, a PCFG parser written in PERPL appears to generate (infinitely many) trees and sum the probabilities of those (exponentially many) trees that yield a given string; yet it compiles to a cubic-sized system of equations whose solution is equivalent to the CKY algorithm.

For more information:

Building the compiler

For more detailed instructions, please see install.md.

To build the compiler (requires GHC):

make

To run tests:

make tests

Using the compiler

To compile a PERPL program:

./perplc [options] FILE.ppl

Options:

-O0 -O1     Optimization level (0 = off, 1 = on)
-l          Don't linearize the file (implies -c -e)
-e          Don't eliminate recursive datatypes (implies -c)
-d DTYPES   Defunctionalize recursive datatypes DTYPES
-r DTYPES   Refunctionalize recursive datatypes DTYPES
-c          Compile only to PPL code (not to FGG)
-z          Compute sum-product
-o OUTFILE  Output an FGG to OUTFILE

Although perplc can compute sum-products, its implementation is not very efficient. The normal usage is to use the -o option to output an FGG to a JSON file. Then the FGG can be processed using the fggs package.

Credits

This code is written by Colin McDonald (University of Notre Dame) with contributions from David Chiang (University of Notre Dame) and Chung-chieh Shan (Indiana University) and is licensed under the MIT License. It is based upon work supported by the National Science Foundation under Award Nos. CCF-2019266 and CCF-2019291.

perpl's People

Contributors

colin-mcd avatar davidweichiang avatar ccshan avatar ziyunma avatar chihyang 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.