Skip to content

Commit

Permalink
revert ife expression support
Browse files Browse the repository at this point in the history
  • Loading branch information
katat committed Jan 22, 2025
1 parent 8826730 commit 5deab01
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
14 changes: 6 additions & 8 deletions examples/fixture/asm/kimchi/hint.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ DoubleGeneric<1,0,0,0,-2>
DoubleGeneric<2,0,-1>
DoubleGeneric<1,-1>
DoubleGeneric<1,-1>
DoubleGeneric<1,0,-1,0,2>
DoubleGeneric<1,-1>
DoubleGeneric<1,0,0,0,-16>
DoubleGeneric<1,0,0,0,-32>
Expand All @@ -23,12 +22,11 @@ DoubleGeneric<1,0,-1,0,1>
DoubleGeneric<1,0,0,0,-1>
DoubleGeneric<1,0,0,0,-1>
DoubleGeneric<1,-1>
(0,0) -> (21,0)
(1,0) -> (2,0) -> (12,1)
(0,0) -> (20,0)
(1,0) -> (2,0) -> (11,1)
(4,0) -> (6,1)
(4,2) -> (5,1)
(5,0) -> (7,0) -> (21,1)
(7,2) -> (8,1)
(12,0) -> (14,0)
(17,1) -> (18,0)
(18,2) -> (19,0)
(5,0) -> (7,1) -> (20,1)
(11,0) -> (13,0)
(16,1) -> (17,0)
(17,2) -> (18,0)
2 changes: 1 addition & 1 deletion examples/fixture/asm/r1cs/hint.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
2 == (v_3) * (1)
2 * v_5 == (v_4) * (1)
v_5 == (v_6) * (1)
v_4 + 2 == (v_7) * (1)
v_4 == (v_7) * (1)
16 == (v_8) * (1)
32 == (v_9) * (1)
4 == (v_10) * (1)
Expand Down
4 changes: 2 additions & 2 deletions examples/hint.no
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ hint fn div(lhs: Field, rhs: Field) -> Field {
}

hint fn ite(lhs: Field, rhs: Field) -> Field {
return if lhs != rhs { lhs + 2 } else { rhs * 2 };
return if lhs != rhs { lhs } else { rhs };
}

hint fn exp(const EXP: Field, base: Field) -> Field {
Expand Down Expand Up @@ -75,7 +75,7 @@ fn main(pub public_input: Field, private_input: Field) -> Field {
assert_eq(zz, yy);

let ww = unsafe ite(xx, yy);
assert_eq(ww, xx + 2);
assert_eq(ww, xx);

let kk = unsafe exp(4, public_input);
assert_eq(kk, 16);
Expand Down

0 comments on commit 5deab01

Please sign in to comment.