Support arrays in witgen.

This commit is contained in:
chriseth
2023-11-02 16:41:34 +01:00
parent 13d1f66e02
commit d94db64b6f
15 changed files with 215 additions and 125 deletions

View File

@@ -0,0 +1,19 @@
let N = 16;
namespace FibArrays(N);
col fixed ISLAST(i) { match i {
N - 1 => 1,
_ => 0,
} };
col witness unused;
col witness x[2];
col witness unused2;
ISLAST * (x[1]' - 1) = 0;
ISLAST * (x[0]' - 1) = 0;
(1-ISLAST) * (x[0]' - x[1]) = 0;
(1-ISLAST) * (x[1]' - (x[0] + x[1])) = 0;
(unused - 1) * unused2 = 0;
public out = x[1](N - 1);