NOTE: This project is defunct.
If you're interested, please check out these more recent projects:
To run a shell:
python run_program.py [-e ENGINE]
To run a program:
python run_program.py [-e ENGINE] [-p PROGRAM]
ENGINE: r = randomdb, t = traces, rt = reduced traces PROGRAM: The directory of some Church program.
RUN A SERVER
All servers conform to a common REST API.
To run the python server:
python server.py [-e ENGINE] [-v] [-p PORT]
To run a C server:
python server.py [-s BINARY] [-v] [-p PORT]
ENGINE: r = randomdb, t = traces, rt = reduced traces BINARY: The directory of some C binary PORT: The number of some port The -v flag toggles whether the server should print its activity
SETUP ON EC2
COMPILING THE C BINARIES
You can also compile a faster version of the server by doing the following:
- (OPTIONAL) Open
socket_server.py, and change engine_type to what you'd like.
- Install pypy.
- Run (replace the path to the pypy folder as appropriate):
python /Applications/pypy/rpython/bin/rpython socket_server.pyFor a tracing JIT version (NOT YET READY):
python /Applications/pypy/rpython/bin/rpython --opt=jit socket_server.pyWARNING: This can take a long time.
- This should create a binary called
socket_server-c. You may want to rename it
DEFINING CUSTOM XRPs
See values.py for class definition
See xrp.py for examples
Remember to set self.sample, depending on whether your XRP is a sampler or rescorer!
ADDING PRIMITIVE PROCEDURES
See directives.py for examples. (Search for "PRIMITIVE PROCEDURES".) The syntax for expressions can be found near the bottom of expressions.py (or you can simply follow the examples). Don't forget the 3rd argument must be set to 'True'.
- Propagation should use a priority queue (it is currently wrong, sometimes)
- Traces could be more intelligent at propagating up through arguments (and then, we can use the proper XRP if)
- Some Jenkins tests fail
- Outermost observe shouldn't be required
- Assumes resampling XRPs are all deterministic
- Needs to use unsample