@nowarp/souffle
v0.1.2
Published
Souffle bindings for JavaScript/TypeScript
Downloads
599
Maintainers
Readme
Souffle.js
Souffle.js offers bindings to Soufflé, an open-source, parallel logic programming language.
Installation
Install the library with Yarn:
yarn add @nowarp/souffle.js
Getting Started
Here is an example implementing the Simple Typed VarPointsTo example:
const ctx = new SouffleContext("VarPointsTo");
// Declare relations
ctx.add(
relation("assign", [
["a", "Symbol"],
["b", "Symbol"],
]),
);
// Add facts
ctx.addFact("assign", ["v1", "v2"]);
// Define and output rules
ctx.add(
relation(
"alias",
[
["a", "Symbol"],
["b", "Symbol"],
],
"output",
),
);
ctx.add(rule([atom("alias", ["X", "X"])], [body(atom("assign", ["X", "_"]))]));
// Execute the Soufflé program
const executor = new SouffleSyncExecutor();
const out = executor.execute(ctx);
console.log("Raw Soufflé output:\n", out.results);
For the full example, see the source here.
Projects Using Souffle.js
- nowarp/misti – Static analyzer for TON smart contracts