Skip to content

ariagivens/perpl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

734 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 about the language, see language.md.

Building the compiler

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). It is licensed under the MIT License.

About

The PERPL Compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 98.1%
  • Other 1.9%