From 45b65b348497ca83d9151311c0018ed8164af11a Mon Sep 17 00:00:00 2001 From: guipublic Date: Tue, 19 Sep 2023 16:26:37 +0000 Subject: [PATCH] split 9_conditional test case and remove 8_integration --- .../8_integration/Prover.toml | 5 - .../8_integration/src/main.nr | 283 ------------------ .../Nargo.toml | 2 +- .../Prover.toml | 0 .../conditional_1/src/main.nr | 100 +++++++ .../Nargo.toml | 2 +- .../conditional_2/Prover.toml | 2 + .../conditional_2/src/main.nr | 54 ++++ .../conditional_3_regression/Nargo.toml | 7 + .../conditional_3_regression/Prover.toml | 38 +++ .../src/main.nr | 126 +------- 11 files changed, 205 insertions(+), 414 deletions(-) delete mode 100644 tooling/nargo_cli/tests/execution_success/8_integration/Prover.toml delete mode 100644 tooling/nargo_cli/tests/execution_success/8_integration/src/main.nr rename tooling/nargo_cli/tests/execution_success/{8_integration => conditional_1}/Nargo.toml (77%) rename tooling/nargo_cli/tests/execution_success/{9_conditional => conditional_1}/Prover.toml (100%) create mode 100644 tooling/nargo_cli/tests/execution_success/conditional_1/src/main.nr rename tooling/nargo_cli/tests/execution_success/{9_conditional => conditional_2}/Nargo.toml (77%) create mode 100644 tooling/nargo_cli/tests/execution_success/conditional_2/Prover.toml create mode 100644 tooling/nargo_cli/tests/execution_success/conditional_2/src/main.nr create mode 100644 tooling/nargo_cli/tests/execution_success/conditional_3_regression/Nargo.toml create mode 100644 tooling/nargo_cli/tests/execution_success/conditional_3_regression/Prover.toml rename tooling/nargo_cli/tests/execution_success/{9_conditional => conditional_3_regression}/src/main.nr (56%) diff --git a/tooling/nargo_cli/tests/execution_success/8_integration/Prover.toml b/tooling/nargo_cli/tests/execution_success/8_integration/Prover.toml deleted file mode 100644 index e4b4fa41073..00000000000 --- a/tooling/nargo_cli/tests/execution_success/8_integration/Prover.toml +++ /dev/null @@ -1,5 +0,0 @@ -a=[867393132, 2339025230, 220695592, 603045882, 2511105607, 2829384008, 3709060370, 165831136, 1055242736, 1021386699, 504214651, 3662346416, 1830680088, 3882307476, 2426040416, 1802701977, 2663953820, 442532338, 1174156258, 2943965281, 2059435796, 2505576606, 666729718, 3602851575, 2784009587, 3495199106, 1721163808, 3787454896, 315490254, 2761503044, 1222736857, 3669200722, 1595984236, 1113969718, 486680564, 3162990949, 3264361924, 2006416798, 2386200406, 315797713, 2613961431, 2248446788, 1487182619, 1426297375, 1728644913, 1251844809, 1725705662, 1593325285, 2204175104, 2086772782, 3535562424, 171941432, 1454717338, 346500936, 3226869878, 1868934392, 4256057877, 1568150812, 3256749490, 2594788417, 1807197388, 3087252400, 1649310565, 2748668146, 3716823811, 3800017989, 932498547, 2480193018, 333760602, 97095822, 4100736518, 2777593334, 2339587180, 3771453942, 3867894936, 3650805881, 1824779553, 1642205658, 4264337791, 4071013475, 1985859040, 4202403275, 2148375036, 2428793574, 314105769, 4225849095, 3500808841, 2684237013, 848348764, 723628347, 1455798875, 3707853370, 1746878741, 1139375098, 3478206320, 3069213335, 112605790, 2440244355, 1471127557, 4092108893] -b=[3828535814, 348916743, 1199414553, 737248839, 756047272, 1292160882, 4257951637, 291617875, 2966142224, 3814394488, 3878026466, 700807834, 2969962294, 1306796485, 3854250602, 898180304, 3427925197, 604266260, 1075521373, 3406840156, 3396422198, 890966269, 1079444598, 988299705, 3071209797, 3808577073, 2135889094, 1194271359, 4006125262, 566871018, 1292670770, 3445252242, 1897364157, 1587048323, 1240078226, 1678980405, 262815752, 304362997, 1104680912, 2632486420, 2463291218, 2187725560, 1870618568, 2652926282, 3004775258, 1952884887, 561428664, 2467226612, 2683547316, 3452779168, 976229927, 1449738410, 3252038428, 2805606398, 1462658417, 1592183545, 2019693157, 3278803512, 3026040550, 566335611, 703403330, 936890230, 2567824938, 890552997, 4217401169, 258050408, 29872215, 812502992, 3871770414, 4261908330, 3703871063, 2429703152, 1496772760, 3466865862, 2739387475, 547994854, 240736540, 3737530356, 545555875, 1243531855, 826369375, 392660683, 262937837, 3055809624, 1979941188, 3982865811, 2062520214, 1365494964, 3851477194, 4086198942, 4210993448, 3262645997, 766395054, 1585427862, 1824837360, 105660195, 3008983983, 845249279, 2566786179, 205438487] -c=[867393132, 2339025230, 220695592, 603045882, ] -d=[3828535814, 348916743, 1199414553, 737248839, ] -m=[77,75,108,209,54,16,50,202,155,210,174,185,217,0,170,77,69,217,234,216,10,201,66,51,116,196,81,167,37,77,7,102] diff --git a/tooling/nargo_cli/tests/execution_success/8_integration/src/main.nr b/tooling/nargo_cli/tests/execution_success/8_integration/src/main.nr deleted file mode 100644 index 52f53efd3aa..00000000000 --- a/tooling/nargo_cli/tests/execution_success/8_integration/src/main.nr +++ /dev/null @@ -1,283 +0,0 @@ -fn matrix_mul_2(a: [u32; 4], b: [u32; 4]) ->[u32; 4] { - let mut c = [0 as u32; 4]; - for i in 0..2 { - for j in 0..2 { - c[i+2*j] = 0; - for k in 0..2 { - c[i+2*j] += a[i+2*k] * b[k+2*j]; - } - } - } - c -} - -fn matrix_mul_10(a: [u32; 100], b: [u32; 100]) -> [u32; 100] { - let mut c = [0 as u32; 100]; - for i in 0..10 { - for j in 0..10 { - c[i+10*j] = 0 as u32; - - for k in 0..10 { - c[i+10*j] += a[i+10*k] * b[k+10*j]; - } - } - } - c -} - - -fn siggy(x: u32) -> u32 { - x * (10 as u32) -} - - -fn test4 (mut a: [u32; 4]) -> [u32; 4] { - for i in 3..4 { - a[i] = siggy(a[i-2]); - } - a -} - -fn iterate1(mut a0: u32) -> u32{ - let mut t1 = 0 as u32; - let mut t2 = 0 as u32; - let mut a = 1 as u32; - let mut f = 2 as u32; - let mut g = 3 as u32; - let mut h = 4 as u32; - - for _i in 0..2 { - t1 = h; - h = g; - g = f; - a = t1 + t2; - } - a0 += a; - a0 -} - -fn array_noteq(a: [u32; 4], b: [u32; 4]) { - assert(a != b); -} - -fn test3(mut b: [Field; 4]) -> [Field; 4] { - for i in 0..4 { - b[i] = i; - } - b -} - -fn iterate2(mut hash: [u32; 8]) -> [u32; 8] { - let mut t1 = 0 as u32; - - let mut a = hash[0]; - let mut e = hash[4]; - let mut f = hash[5]; - let mut g = hash[6]; - let mut h = hash[7]; - - for _i in 0..2 { - t1 = ch2(e, f); - h = g; - g = f; - a = t1; - } - - hash[0] = hash[0] + a; - hash -} - -fn iterate3( mut hash: [u32; 8]) -> [u32; 8] { - let mut t1 = 0 as u32; - let mut t2 = 0 as u32; - let mut a = hash[0]; - let mut b = hash[1]; - let mut c = hash[2]; - let mut d = hash[3]; - let mut e = hash[4]; - let mut f = hash[5]; - let mut g = hash[6]; - let mut h = hash[7]; - - for _i in 0..3 { - t1 = ep2(e)+ch2(e, f); - h = g; - g = f; - a = t1+t2; - } - assert(a == 2470696267); - hash[0] = hash[0] + a; - hash[1] = hash[1] + b; - hash[2] = hash[2] + c; - hash[3] = hash[3] + d; - hash[4] = hash[4] + e; - hash[5] = hash[5] + f; - hash[6] = hash[6] + g; - hash[7] = hash[7] + h; - hash -} - - -fn test5() { - let mut sha_hash = [ - 0 as u32, 1, 2, 3, - 4, 5, 6, 7 - ]; - - sha_hash = iterate2(sha_hash); - - assert(sha_hash[0] == 9); -} - - -fn ch2(x: u32, y: u32) -> u32 { - x + y -} - -fn ep2(x: u32) -> u32 { - (2 as u32) * too(x) -} - -fn too(x: u32) -> u32 { - (x + 17 as u32) * (x + 3 as u32) -} - -fn test6(x: [u8; 32]) -> [u32; 8] { - let mut sha_m = [0 as u32; 64]; - - let mut sha_hash = [ - 1 as u32, 2, 3, 4, 5, 6, 7, 8 - ]; - - let mut buffer = [0 as u8; 64]; - for i in 0..32 { - buffer[i] = x[i]; - } - - sha_m = iterate6_1(sha_m, buffer); - sha_hash = iterate6_2(sha_m, sha_hash); - sha_hash -} - -fn iterate6_1(mut sha_m: [u32; 64], next_chunk: [u8; 64]) -> [u32; 64] { - let mut j = 0; - for i in 0..16 { - j = (i ) * 4; - sha_m[i] = ((next_chunk[j] as u32) << 24 as u32) - | ((next_chunk[j + 1] as u32) << 16 as u32) - | ((next_chunk[j + 2] as u32) << 8 as u32) - | (next_chunk[j + 3] as u32); - } - for i in 16..64 { - sha_m[i] = sig1(sha_m[i - 2])+(sha_m[i - 7])+(sig0(sha_m[i - 15]))+(sha_m[i - 16]); - } - sha_m -} - -fn iterate6_2(sha_m: [u32; 64], mut hash: [u32; 8]) -> [u32; 8] { - let mut t1 = 0 as u32; - let mut t2 = 0 as u32; - let mut a = 1 as u32; - let mut b = 2 as u32; - let mut c = 3 as u32; - let mut d = 4 as u32; - let mut e = 5 as u32; - let mut f = 6 as u32; - let mut g = 7 as u32; - let mut h = 8 as u32; - - for i in 0..11 { - t1 = h + ep1(e) + ch(e, f, g) + sha_m[i]; - t2 = epo(a) + maj(a, b, c); - h = g; - g = f; - f = e; - e = d+t1; - d = c; - c = b; - b = a; - a = t1+t2; - } - - hash[0] = hash[0]+a; - hash[1] = hash[1]+b; - hash[2] = hash[2]+c; - hash[3] = hash[3]+d; - hash[4] = hash[4]+e; - hash[5] = hash[5]+f; - hash[6] = hash[6]+g; - hash[7] = hash[7]+h; - hash -} - -fn rot_right(a: u32, b: u32) -> u32 { - ((a >> b) | (a << (32 as u32 - b))) -} - - -fn ch(x: u32, y: u32, z: u32) -> u32 { - ((x & y) ^ (!x & z)) -} - - -fn maj(x: u32, y: u32, z: u32) -> u32 { - ((x & y) ^ (x & z) ^ (y & z)) -} - - -fn epo(x: u32) -> u32 { - (rot_right(x, 2) ^ rot_right(x, 13) ^ rot_right(x, 22)) -} - -fn ep1(x: u32) -> u32 { - (rot_right(x, 6) ^ rot_right(x, 11) ^ rot_right(x, 25)) -} - -fn sig0(x: u32) -> u32 { - (rot_right(x, 7) ^ rot_right(x, 18) ^ (x >> 3)) -} - -fn sig1(x: u32) -> u32 { - (rot_right(x, 17) ^ rot_right(x, 19) ^ (x >> 10)) -} - - -fn main(a: [u32; 100], b: [u32; 100], c: [u32; 4], mut d: [u32; 4], m: [u8; 32]) { - let e = matrix_mul_10(a,b); - assert(e[6] == 1866842232); - let f = matrix_mul_2(c,d); - assert(f[3] == 2082554100); - - let mut a = [1 as u32, 2, 3, 4]; - a = test4(a); - assert(a[3] == 20); - a = test4(c); - assert(a[3] == c[1] * 10); - - d[0] += c[0]; - d[0] += c[1]; - assert(d[0] == 2739986880); - - let h = iterate1(1); - assert(h == 4); - - let x = d; - array_noteq(x, [d[0], d[1], d[2], 0]); - - let mut h5 = [d[0] as Field, d[1] as Field, d[2] as Field, d[3] as Field]; - let t5 = test3(h5); - assert(t5[3] == 3); - h5 = test3(h5); - assert(h5[3] == 3); - - test5(); - - let mut sha_hash = [ - 0x6a09e667 as u32, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - ]; - sha_hash = iterate3(sha_hash); - - let h6 = test6(m); - assert(h6[0] == 523008072); //31.. 3800709683 -} diff --git a/tooling/nargo_cli/tests/execution_success/8_integration/Nargo.toml b/tooling/nargo_cli/tests/execution_success/conditional_1/Nargo.toml similarity index 77% rename from tooling/nargo_cli/tests/execution_success/8_integration/Nargo.toml rename to tooling/nargo_cli/tests/execution_success/conditional_1/Nargo.toml index 56a156ee1d7..af1efa03e82 100644 --- a/tooling/nargo_cli/tests/execution_success/8_integration/Nargo.toml +++ b/tooling/nargo_cli/tests/execution_success/conditional_1/Nargo.toml @@ -1,5 +1,5 @@ [package] -name = "8_integration" +name = "conditional_1" type = "bin" authors = [""] compiler_version = "0.1" diff --git a/tooling/nargo_cli/tests/execution_success/9_conditional/Prover.toml b/tooling/nargo_cli/tests/execution_success/conditional_1/Prover.toml similarity index 100% rename from tooling/nargo_cli/tests/execution_success/9_conditional/Prover.toml rename to tooling/nargo_cli/tests/execution_success/conditional_1/Prover.toml diff --git a/tooling/nargo_cli/tests/execution_success/conditional_1/src/main.nr b/tooling/nargo_cli/tests/execution_success/conditional_1/src/main.nr new file mode 100644 index 00000000000..4d1eeae0fe7 --- /dev/null +++ b/tooling/nargo_cli/tests/execution_success/conditional_1/src/main.nr @@ -0,0 +1,100 @@ +use dep::std; + +fn sort(mut a: [u32; 4]) -> [u32; 4] { + for i in 1..4 { + for j in 0..i { + if a[i] < a[j] { + let c = a[j]; + a[j] = a[i]; + a[i] = c; + } + } + } + a +} + + +fn must_be_zero(x: u8) { + assert(x == 0); +} + +fn main(a: u32, mut c: [u32; 4], x: [u8; 5], result: pub [u8; 32]){ + + //Test case for short-circuit + let mut data = [0 as u32; 32]; + let mut ba = a; + for i in 0..32 { + let i_u32 = i as u32; + if i_u32 == a { + for j in 0..4 { + data[i + j] = c[4 - 1 - j]; + for k in 0..4 { + ba = ba +data[k]; + } + if ba == 4864 { + c[3]=ba; + } + } + } + } + assert(data[31] == 0); + assert(ba != 13); + + + //Test case for conditional with arrays from function parameters + let b = sort([1,2,3,4]); + assert(b[0] == 1); + + if a == 0 { + must_be_zero(0); + c[0] = 3; + } else { + must_be_zero(1); + c[0] = 1; + c[1] = c[2] / a + 11 % a; + let f1 = a as Field; + assert(10/f1 != 0); + } + assert(c[0] == 3); + + let mut y = 0; + if a == 0 { + let digest = std::hash::sha256(x); + y = digest[0]; + } else { + y = 5; + } + assert(y == result[0]); + c = sort(c); + assert(c[0] == 0); + + //test 1 + let mut x: u32 = 0; + if a == 0 { + c[0] = 12; + if a != 0 { + x = 6; + } else { + x = 2; + assert(x == 2); + } + } else { + x = 5; + assert(x == 5); + } + if c[0] == 0 { + x = 3; + } + assert(x == 2); + + //test2: loops + let mut x: u32 = 0; + x = a - a; + for i in 0..4 { + if c[i] == 0 { + x = i as u32 +2; + } + } + assert(x == 0); + +} \ No newline at end of file diff --git a/tooling/nargo_cli/tests/execution_success/9_conditional/Nargo.toml b/tooling/nargo_cli/tests/execution_success/conditional_2/Nargo.toml similarity index 77% rename from tooling/nargo_cli/tests/execution_success/9_conditional/Nargo.toml rename to tooling/nargo_cli/tests/execution_success/conditional_2/Nargo.toml index 3aa36068cf2..1401a715eef 100644 --- a/tooling/nargo_cli/tests/execution_success/9_conditional/Nargo.toml +++ b/tooling/nargo_cli/tests/execution_success/conditional_2/Nargo.toml @@ -1,5 +1,5 @@ [package] -name = "9_conditional" +name = "conditional_2" type = "bin" authors = [""] compiler_version = "0.1" diff --git a/tooling/nargo_cli/tests/execution_success/conditional_2/Prover.toml b/tooling/nargo_cli/tests/execution_success/conditional_2/Prover.toml new file mode 100644 index 00000000000..73fa4a5e31a --- /dev/null +++ b/tooling/nargo_cli/tests/execution_success/conditional_2/Prover.toml @@ -0,0 +1,2 @@ +c=[2, 4, 3, 0, ] +a=0 diff --git a/tooling/nargo_cli/tests/execution_success/conditional_2/src/main.nr b/tooling/nargo_cli/tests/execution_success/conditional_2/src/main.nr new file mode 100644 index 00000000000..af5b46c003e --- /dev/null +++ b/tooling/nargo_cli/tests/execution_success/conditional_2/src/main.nr @@ -0,0 +1,54 @@ +use dep::std; + + +fn must_be_zero(x: u8) { + assert(x == 0); +} + +fn test3 (x: u8) { + if x == 0 { + must_be_zero(x); + } +} + +fn test4() -> [u32; 4] { + let b: [u32; 4] = [1,2,3,4]; + b +} + +fn main(a: u32, mut c: [u32; 4]) { + + test3(1); + + if a == 0 { + c = test4(); + } else { + assert(c[1] != 2); + } + if false { + c[1] = 5; + } + assert(c[1] == 2); + + test5(4); + + // Test case for function synchronisation + let mut c_sync = 0; + if a == 42 { + c_sync = foo2(); + } else { + c_sync = foo2() + foo2(); + } + assert(c_sync == 6); +} + +fn test5(a : u32) { + if a > 1 { + let q = a / 2; + assert(q == 2); + } +} + +fn foo2() -> Field { + 3 +} diff --git a/tooling/nargo_cli/tests/execution_success/conditional_3_regression/Nargo.toml b/tooling/nargo_cli/tests/execution_success/conditional_3_regression/Nargo.toml new file mode 100644 index 00000000000..868208a4fe2 --- /dev/null +++ b/tooling/nargo_cli/tests/execution_success/conditional_3_regression/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "conditional_3_regression" +type = "bin" +authors = [""] +compiler_version = "0.1" + +[dependencies] diff --git a/tooling/nargo_cli/tests/execution_success/conditional_3_regression/Prover.toml b/tooling/nargo_cli/tests/execution_success/conditional_3_regression/Prover.toml new file mode 100644 index 00000000000..baad8be126a --- /dev/null +++ b/tooling/nargo_cli/tests/execution_success/conditional_3_regression/Prover.toml @@ -0,0 +1,38 @@ +c=[2, 4, 3, 0, ] +a=0 +x = [104, 101, 108, 108, 111] + +result = [ + 0x2c, + 0xf2, + 0x4d, + 0xba, + 0x5f, + 0xb0, + 0xa3, + 0x0e, + 0x26, + 0xe8, + 0x3b, + 0x2a, + 0xc5, + 0xb9, + 0xe2, + 0x9e, + 0x1b, + 0x16, + 0x1e, + 0x5c, + 0x1f, + 0xa7, + 0x42, + 0x5e, + 0x73, + 0x04, + 0x33, + 0x62, + 0x93, + 0x8b, + 0x98, + 0x24, +] diff --git a/tooling/nargo_cli/tests/execution_success/9_conditional/src/main.nr b/tooling/nargo_cli/tests/execution_success/conditional_3_regression/src/main.nr similarity index 56% rename from tooling/nargo_cli/tests/execution_success/9_conditional/src/main.nr rename to tooling/nargo_cli/tests/execution_success/conditional_3_regression/src/main.nr index c1091304e03..cc3e2b2c5ba 100644 --- a/tooling/nargo_cli/tests/execution_success/9_conditional/src/main.nr +++ b/tooling/nargo_cli/tests/execution_success/conditional_3_regression/src/main.nr @@ -1,17 +1,6 @@ use dep::std; -fn sort(mut a: [u32; 4]) -> [u32; 4] { - for i in 1..4 { - for j in 0..i { - if a[i] < a[j] { - let c = a[j]; - a[j] = a[i]; - a[i] = c; - } - } - } - a -} + fn call_intrinsic(x: [u8; 5], result: [u8; 32]) { let mut digest = std::hash::sha256(x); @@ -20,16 +9,6 @@ fn call_intrinsic(x: [u8; 5], result: [u8; 32]) { assert(digest == result); } -fn must_be_zero(x: u8) { - assert(x == 0); -} - -fn test3 (x: u8) { - if x == 0 { - must_be_zero(x); - } -} - fn test4() -> [u32; 4] { let b: [u32; 4] = [1,2,3,4]; b @@ -87,25 +66,6 @@ fn main(a: u32, mut c: [u32; 4], x: [u8; 5], result: pub [u8; 32]){ let result1_false = test(false); assert(result1_false.array_param[0] == 0); - //Test case for short-circuit - let mut data = [0 as u32; 32]; - let mut ba = a; - for i in 0..32 { - let i_u32 = i as u32; - if i_u32 == a { - for j in 0..4 { - data[i + j] = c[4 - 1 - j]; - for k in 0..4 { - ba = ba +data[k]; - } - if ba == 4864 { - c[3]=ba; - } - } - } - } - assert(data[31] == 0); - assert(ba != 13); //regression for short-circuit2 if 35 == a { assert(false); @@ -118,93 +78,15 @@ fn main(a: u32, mut c: [u32; 4], x: [u8; 5], result: pub [u8; 32]){ assert(c[1] != 2); call_intrinsic(x, result); - //Test case for conditional with arrays from function parameters - let b = sort([1,2,3,4]); - assert(b[0] == 1); - - if a == 0 { - must_be_zero(0); - c[0] = 3; - } else { - must_be_zero(1); - c[0] = 1; - c[1] = c[2] / a + 11 % a; - let f1 = a as Field; - assert(10/f1 != 0); - } - assert(c[0] == 3); - - let mut y = 0; - if a == 0 { - let digest = std::hash::sha256(x); - y = digest[0]; - } else { - y = 5; - } - assert(y == result[0]); - c = sort(c); - assert(c[0] == 0); - - //test 1 - let mut x: u32 = 0; - if a == 0 { - c[0] = 12; - if a != 0 { - x = 6; - } else { - x = 2; - assert(x == 2); - } - } else { - x = 5; - assert(x == 5); - } - if c[0] == 0 { - x = 3; - } - assert(x == 2); - - //test2: loops! - x = 0; - x = a - a; - for i in 0..4 { - if c[i] == 0 { - x = i as u32 +2; - } - } - assert(x == 0); - - test3(1); - - if a == 0 { - c = test4(); - } else { - assert(c[1] != 2); - } - if false { - c[1] = 5; - } - assert(c[1] == 2); - - test5(4); // Regression for issue #661: let mut c_661 :[u32;1]=[0]; if a > 5 { c_661 = issue_661_foo(issue_661_bar(c), a); } else { - c_661 = issue_661_foo(issue_661_bar(c), x); + c_661 = issue_661_foo(issue_661_bar(c), a + 2); } assert(c_661[0] < 20000); - - // Test case for function synchronisation - let mut c_sync = 0; - if a == 42 { - c_sync = foo2(); - } else { - c_sync = foo2() + foo2(); - } - assert(c_sync == 6); // Regression for predicate simplification safe_inverse(0); @@ -262,10 +144,6 @@ fn issue_661_bar(a : [u32;4]) ->[u32;4] { b } -fn foo2() -> Field { - 3 -} - fn safe_inverse(n: Field) -> Field { if n == 0 {