Metadata-Version: 2.1
Name: scallopy
Version: 0.1.0
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# `scallopy`, the Python binding for Scallop

## Sample usage

``` python
from scallopy import ScallopContext

# Create new context
ctx = ScallopContext()

# Construct the program
ctx.add_relation("edge", (int, int))
ctx.add_facts("edge", [(0, 1), (1, 2), (2, 3)])
ctx.add_rule("path(a, c) = edge(a, c)")
ctx.add_rule("path(a, c) = edge(a, b), path(b, c)")

# Run the program
ctx.run()

# Inspect the result
paths = ctx.relation("path")
for (s, t) in paths:
  print(f"elem: ({s}, {t})")
```

## Build

Make sure you are currently inside of a python virtual env, and have `maturin` installed. Then do

``` bash
$ maturin develop --release # release is important for speed
```

That's it! You can then run one of our example

``` bash
$ python examples/incr_edge_path.py
```

## Documentation

Please check out the following file [`scallopy/scallopy.pyi`](scallopy/scallopy.pyi) for documentation.

