You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let N = 4;
namespace Test(N);
col fixed ISLAST(i) { if i == N - 1 { 1 } else { 0 } };
col fixed INDEX(i) { i };
col witness w, sum;
// Compute the witness from the index
w = INDEX + 1;
// The sum should be the sum of all witnesses, op to the current row.
sum' = (1 - ISLAST) * sum + w';
// Note that adding this equivalent constraint resolves the issue.
// sum' = (1 - ISLAST) * sum + (INDEX' + 1);
This can be solved by running the following steps:
Process w = INDEX + 1 in row 0:
-> Set w[0] = 1
Process sum' = (1 - ISLAST) * sum + w' on row 3:
-> Set sum[0] = 1
Process w = INDEX + 1 in row 1:
-> Set w[1] = 2
Process sum' = (1 - ISLAST) * sum + w' on row 0:
-> Set sum[1] = 3
...
Instead, the VM processor never figures our a value of sum and eventually sets it to 0, violating the constraints. To see that, run: cargo run pil test.pil -o output -f --export-witness-csv --prove-with mock
The reason is that w = INDEX + 1 needs to processed on the next row before sum' = (1 - ISLAST) * sum + w can be completed on the current row.
The text was updated successfully, but these errors were encountered:
Consider this example:
This can be solved by running the following steps:
w = INDEX + 1
in row 0:w[0] = 1
sum' = (1 - ISLAST) * sum + w'
on row 3:sum[0] = 1
w = INDEX + 1
in row 1:w[1] = 2
sum' = (1 - ISLAST) * sum + w'
on row 0:sum[1] = 3
Instead, the VM processor never figures our a value of
sum
and eventually sets it to 0, violating the constraints. To see that, run:cargo run pil test.pil -o output -f --export-witness-csv --prove-with mock
The reason is that
w = INDEX + 1
needs to processed on the next row beforesum' = (1 - ISLAST) * sum + w
can be completed on the current row.The text was updated successfully, but these errors were encountered: