This project implements a proof-of-concept-debugger for probabilistic programming languages.
It currently handles a very simple toy language (called SL for Simple Language) with a C-like syntax that has the following well-known constructs:
- Variable declarations:
int x = y + 2
- Variable assignments:
x = x + 1
- Expressions with the following well-known operators:
+
,-
,==
,<
- Discrete probability distributions:
int x = discrete({1: 0.2, 2: 0.8})
(x
gets assigned1
with probability0.2
and2
with probability0.8
) - If-Statements:
if x < 3 { ... }
- While-Loops:
while x < 3 { ... }
- Observe statements:
observe(x < 3)
orobserver x < 3
Install Xcode and open the project by opening Package.swift
. To run the tests, select Product -> Test (Cmd-U)
In terminal cd
to this project, then execute swift test
to run the tests