mirror of
https://github.com/circify/circ.git
synced 2026-04-21 03:00:54 -04:00
Merge branch 'master' into c_frontend
This commit is contained in:
34
scripts/test_zok_to_ilp_pf.zsh
Executable file
34
scripts/test_zok_to_ilp_pf.zsh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
set -ex
|
||||
|
||||
disable -r time
|
||||
|
||||
cargo build --release --example circ
|
||||
|
||||
BIN=./target/release/examples/circ
|
||||
|
||||
function ilp_test {
|
||||
zpath=$1
|
||||
expected_max=$2
|
||||
max=$($BIN --maximize $zpath | grep 'Max va' | awk '{ print $3 }')
|
||||
if [[ $max == $expected_max ]]
|
||||
then
|
||||
$BIN --prove-high-value $max $zpath --proof-action prove --inputs assignment.txt
|
||||
echo "pass: $zpath"
|
||||
rm assignment.txt
|
||||
else
|
||||
echo "fail: $zpath"
|
||||
echo "expected max: $expected_max"
|
||||
echo "got max: $max"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
ilp_test examples/ZoKrates/opt/3_plus_opt.zok 255
|
||||
ilp_test examples/ZoKrates/opt/id_opt.zok 255
|
||||
ilp_test examples/ZoKrates/opt/plus_3_opt.zok 255
|
||||
ilp_test examples/ZoKrates/opt/times_2_opt.zok 254
|
||||
ilp_test examples/ZoKrates/opt/times_3_opt.zok 255
|
||||
ilp_test examples/ZoKrates/opt/log.zok 255
|
||||
ilp_test examples/ZoKrates/opt/log16.zok 65535
|
||||
Reference in New Issue
Block a user