Picus

Picus is a symbolic virtual machine for automated verification tasks on R1CS.

Dependencies

Usage

Normal Version (w/ No Special Algorithm)

usage: test-uniqueness.rkt [ <option> ... ]

<option> is one of

  --r1cs <p-r1cs>
     path to target r1cs
  --solver <p-solver>
     solver to use: z3 | cvc5 (default: z3)
  --timeout <p-timeout>
     timeout for every small query (default: 5000ms)
  --smt
     show path to generated smt files (default: false)
  --help, -h
     Show this help
  --
     Do not treat any remaining argument as a switch (at this level)

 Multiple single-letter switches can be combined after
 one `-`. For example, `-h-` is the same as `-h --`.

Naive Slicing Version (w/ Naive Slicing)

usage: test-inc-uniqueness.rkt [ <option> ... ]

<option> is one of

  --r1cs <p-r1cs>
     path to target r1cs
  --solver <p-solver>
     solver to use: z3 | cvc5 (default: z3)
  --timeout <p-timeout>
     timeout for every small query (default: 5000ms)
  --smt
     show path to generated smt files (default: false)
  --help, -h
     Show this help
  --
     Do not treat any remaining argument as a switch (at this level)

 Multiple single-letter switches can be combined after
 one `-`. For example, `-h-` is the same as `-h --`.

Propagation & Preserving Version

usage: test-pp-uniqueness.rkt [ <option> ... ]

<option> is one of

  --r1cs <p-r1cs>
     path to target r1cs
  --solver <p-solver>
     solver to use: z3 | cvc5 (default: z3)
  --timeout <p-timeout>
     timeout for every small query (default: 5000ms)
  --smt
     show path to generated smt files (default: false)
  --help, -h
     Show this help
  --
     Do not treat any remaining argument as a switch (at this level)

 Multiple single-letter switches can be combined after
 one `-`. For example, `-h-` is the same as `-h --`.

Example Commands

# example test for the r1cs utilities
racket ./test-read-r1cs.rkt --r1cs ./benchmarks/circomlib-cff5ab6/EscalarMulAny@escalarmulany.r1cs

# check uniqueness in one shot, using z3 solver
# timeout is 10s, output and show path to smt
racket ./test-uniqueness.rkt --r1cs ./benchmarks/circomlib-cff5ab6/Bits2Num@bitify.r1cs --timeout 10000 --smt --solver z3

# check uniqueness using slicing, using cvc5
# timeout is 3s, output and show path to smt
racket ./test-inc-uniqueness.rkt --r1cs ./benchmarks/circomlib-cff5ab6/Mux4@mux4.r1cs --timeout 3000 --smt --solver cvc5

# prepare a set of benchmarks (run from repo root)
./scripts/prepare-iden3-core.sh

Other Commands

# build circom parser
cd circom-parser
cargo build

# use circom parser
./circom-parser/target/debug/parser ./examples/test10.circom > ./examples/test10.json
./circom-parser/target/debug/parser ./benchmarks/ecne/Num2BitsNeg@bitify.circom > ./benchmarks/ecne/Num2BitsNeg@bitify.json

# simple circom compilation command
# circom ./test0.circom --r1cs --wasm --sym --c
circom -o ./examples/ ./examples/test10.circom --r1cs --sym
circom -o ./benchmarks/ecne/ ./benchmarks/ecne/Num2BitsNeg@bitify.circom --r1cs --sym

# grab Ecne's readable constraints only
julia --project=. src/gen_benchmark.jl Circom_Functions/benchmarks/bigmod_5_2.r1cs > Circom_Functions/benchmarks/bigmod_5_2.txt

# calling Ecne
circom -o ./target/ ./ecne_circomlib_tests/ooo.circom --r1cs --sym --O0
julia --project=. src/Ecne.jl --r1cs target/ooo.r1cs --name oooo --sym target/ooo.sym

Resources

Description
No description provided
Readme MIT 18 MiB
Languages
Circom 96.1%
Racket 2.4%
Rust 0.8%
Shell 0.3%
Jupyter Notebook 0.2%
Other 0.2%