Metadata-Version: 2.1
Name: sppl
Version: 1.2.0
Summary: The Sum-Product Probabilistic Language
Home-page: https://github.com/probcomp/sppl
Maintainer: Feras A. Saad
Maintainer-email: fsaad@mit.edu
License: Apache-2.0
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: astunparse (==1.6.3)
Requires-Dist: numpy (==1.16.6)
Requires-Dist: scipy (==1.4.1)
Requires-Dist: sympy (==1.6)
Provides-Extra: all
Requires-Dist: astunparse (==1.6.3) ; extra == 'all'
Requires-Dist: numpy (==1.16.6) ; extra == 'all'
Requires-Dist: scipy (==1.4.1) ; extra == 'all'
Requires-Dist: sympy (==1.6) ; extra == 'all'
Requires-Dist: graphviz (==0.13.2) ; extra == 'all'
Requires-Dist: ipython (==7.13.0) ; extra == 'all'
Requires-Dist: jupyter-core (==4.6.3) ; extra == 'all'
Requires-Dist: networkx (==2.4) ; extra == 'all'
Requires-Dist: notebook (==6.0.3) ; extra == 'all'
Requires-Dist: matplotlib (==3.3.2) ; extra == 'all'
Requires-Dist: pygraphviz (==1.5) ; extra == 'all'
Requires-Dist: pytest-timeout (==1.3.3) ; extra == 'all'
Requires-Dist: pytest (==5.2.2) ; extra == 'all'
Requires-Dist: coverage (==5.3) ; extra == 'all'
Provides-Extra: magics
Requires-Dist: graphviz (==0.13.2) ; extra == 'magics'
Requires-Dist: ipython (==7.13.0) ; extra == 'magics'
Requires-Dist: jupyter-core (==4.6.3) ; extra == 'magics'
Requires-Dist: networkx (==2.4) ; extra == 'magics'
Requires-Dist: notebook (==6.0.3) ; extra == 'magics'
Requires-Dist: matplotlib (==3.3.2) ; extra == 'magics'
Requires-Dist: pygraphviz (==1.5) ; extra == 'magics'
Provides-Extra: src
Requires-Dist: astunparse (==1.6.3) ; extra == 'src'
Requires-Dist: numpy (==1.16.6) ; extra == 'src'
Requires-Dist: scipy (==1.4.1) ; extra == 'src'
Requires-Dist: sympy (==1.6) ; extra == 'src'
Provides-Extra: tests
Requires-Dist: pytest-timeout (==1.3.3) ; extra == 'tests'
Requires-Dist: pytest (==5.2.2) ; extra == 'tests'
Requires-Dist: coverage (==5.3) ; extra == 'tests'

[![Actions Status](https://github.com/probcomp/sppl/workflows/Python%20package/badge.svg)](https://github.com/probcomp/sppl/actions)
[![pypi](https://img.shields.io/pypi/v/sppl.svg)](https://pypi.org/project/sppl/)

<img src="./sppl.png" width="200">

Sum-Product Probabilistic Language
==================================

SPPL is a probabilistic programming language that delivers exact solutions
to a broad range of probabilistic inference queries. SPPL handles
continuous, discrete, and mixed-type distributions; many-to-one numerical
transformations; and a query language that includes general predicates on
random variables.

Users express generative models as imperative programs with standard
programming constructs, such as arrays, if/else, for loops, etc. The
program is then translated to a sum-product representation (a
generalization of [sum-product
networks](https://arxiv.org/pdf/2004.01167.pdf)) that statically represents
the probability distribution on all random variables in the program and is
used as the basis of probabilistic inference.

A system description of SPPL is given in:

> Exact Symbolic Inference in Probabilistic Programs via Sum-Product Representations. <br/>
> Feras A. Saad, Martin C. Rinard, and Vikash K. Mansinghka. <br/>
> https://arxiv.org/abs/2010.03485

### Installation

This software is tested on Ubuntu 18.04 and requires a Python 3.6+
environment. SPPL is available on PyPI

    $ pip install sppl

To install the Jupyter interface, first obtain the system-wide dependencies in
[requirements.sh](https://github.com/probcomp/sppl/blob/master/requirements.sh)
and then run

    pip install 'sppl[magics]'

### Examples

The easiest way to use SPPL is via the browser-based Jupyter interface, which
allows for interactive modeling, querying, and plotting.
Refer to the `.ipynb` notebooks under the
[examples](https://github.com/probcomp/sppl/tree/master/examples) directory.

### Benchmarks

Refer to https://github.com/probcomp/sppl-benchmarks-oct20

### Language Reference

Coming Soon!

### Tests

To run the test suite as a user, first install with `pip install 'sppl[tests]'`
and then run:

    $ python -m pytest --pyargs sppl

To run the test suite as a developer:

- To run crash tests:             `$ ./check.sh`
- To run integration tests:       `$ ./check.sh ci`
- To run a specific test:         `$ ./check.sh [<pytest-opts>] /path/to/test.py`
- To run the examples:            `$ ./check.sh examples`
- To build a docker image:        `$ ./check.sh docker`
- To generate a coverage report:  `$ ./check.sh coverage`

To view the coverage report, open `htmlcov/index.html` in the browser.

### License

Apache 2.0; see [LICENSE.txt](./LICENSE.txt)

### Acknowledgments

The [logo](./sppl.png) was designed by [McCoy R. Becker](https://femtomc.github.io/).


