anoma / vamp-ir

Vamp-IR is a proof-system-agnostic language for writing arithmetic circuits
https://anoma.github.io/VampIR-Book/
Apache License 2.0
156 stars 44 forks source link

Add command to export witnesses into template json file. #73

Closed AHartNtkn closed 1 year ago

AHartNtkn commented 1 year ago

This adds a new command called generate, along with a subcommand (currently the only subcommand) called witness-file. This will find all the free variables that require solicitation and put them in a template .json file. For example, take this file;

pub x;

def d = {
  1 = y;
  2 * y
};

x + d = 13;

assuming it's saved as vrs.pir inside the tests directory, one can run the following command

./target/debug/vamp-ir generate witness-file -s tests/vrs.pir -o tests/wits.json

and it will produce a new file called wits.json in the tests directory with the following contents;

{
  "x": "?",
  "y": "?"
}

Closes #62