Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor for basic constraints #48

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0ea19d7
add neg/add/mul backend interfaces
katat Apr 22, 2024
4d32ca7
impl neg constraint
katat Apr 22, 2024
ec3bf05
update asm
katat Apr 22, 2024
bb6b818
add span arg to basic constraint interface
katat Apr 22, 2024
b9797ee
move add of field constraint to kimchi backend
katat Apr 22, 2024
cce2669
move mul constraint of field to kimchi backend
katat Apr 22, 2024
3472824
refactor boolean constraints using basic constraints
katat Apr 22, 2024
7f1862d
add neg wrapper in field constraint, so as to be consistent.
katat Apr 22, 2024
02345e8
refactor sub constraint
katat Apr 22, 2024
654dda3
refactor if_else constraint
katat Apr 22, 2024
1dd5684
refactor equal_cells
katat Apr 22, 2024
eeaf71a
add backend interfaces for assert eq constraints
katat Apr 23, 2024
ba9233e
fix: under-constraint
katat Apr 23, 2024
e2ad54c
test: update asm
katat Apr 23, 2024
01b0ebf
rename constraint interface
katat Apr 23, 2024
76e43c9
refactor args for neg interface
katat Apr 23, 2024
70c8358
refactor args for add interface
katat Apr 23, 2024
314422c
refactor args for mul interface
katat Apr 23, 2024
7efa2ab
refactor check fn
katat Apr 23, 2024
4378fc1
refactor: and operation
katat Apr 23, 2024
bff163f
refactor: not operation
katat Apr 23, 2024
f5fe05e
add backend constraint for inputs and outputs
katat Apr 23, 2024
e4cd10f
revert test
katat Apr 23, 2024
4b004b2
fmt
katat Apr 23, 2024
cea6a71
move public_input_size to kimchi backend
katat Apr 24, 2024
a92fea9
move add_gate and add_generic_gate to kimchi backend
katat Apr 24, 2024
427f04e
outdated note
katat Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions examples/bool.asm
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
@ noname.0.7.0

DoubleGeneric<1>
DoubleGeneric<-1,0,0,1>
DoubleGeneric<-1,0,0,1>
DoubleGeneric<0,-1,-1,0,1>
DoubleGeneric<0,-1,0,0,1>
DoubleGeneric<0,-1,0,0,1>
(0,0) -> (1,0) -> (1,1) -> (5,1)
(2,0) -> (2,1) -> (3,1)
(3,2) -> (4,1)
DoubleGeneric<1,0,-1,0,-1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<1>
DoubleGeneric<1,0,-1,0,-1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,0,-1,0,1>
DoubleGeneric<1,0,-1,0,-1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<1>
DoubleGeneric<1,0,0,0,-1>
DoubleGeneric<1,0,0,0,-1>
(0,0) -> (1,0) -> (2,0) -> (13,0)
(1,2) -> (2,1)
(2,2) -> (3,0)
(4,0) -> (5,0) -> (7,0)
(4,2) -> (5,1)
(5,2) -> (6,0)
(7,2) -> (8,0)
(8,2) -> (9,0) -> (10,0) -> (12,0)
(9,2) -> (10,1)
(10,2) -> (11,0)
50 changes: 33 additions & 17 deletions examples/equals.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,39 @@

DoubleGeneric<1>
DoubleGeneric<1>
DoubleGeneric<1,-1,-1>
DoubleGeneric<1,1,0,0,-1>
DoubleGeneric<0,0,0,1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,1,-1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,0,-1,0,1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<0,-1,0,0,1>
DoubleGeneric<1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<1,-1>
DoubleGeneric<1,0,0,0,-1>
DoubleGeneric<1,0,0,0,-3>
DoubleGeneric<1,-1,-1>
DoubleGeneric<1,1,0,0,-1>
DoubleGeneric<0,0,0,1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,1,-1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,0,-1,0,1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<0,-1,0,0,1>
(0,0) -> (2,1) -> (8,1)
(1,0) -> (2,0)
(2,2) -> (4,1) -> (5,1)
(3,0) -> (5,2)
(3,1) -> (4,0) -> (6,1)
(7,0) -> (8,0)
(8,2) -> (10,1) -> (11,1)
(9,0) -> (11,2)
(9,1) -> (10,0) -> (12,1)
DoubleGeneric<1,-1>
DoubleGeneric<1,0,0,0,-1>
(0,0) -> (2,0) -> (12,0)
(1,0) -> (3,0)
(2,2) -> (3,1)
(3,2) -> (6,1) -> (8,1)
(4,0) -> (6,0) -> (10,0)
(4,2) -> (5,0)
(5,2) -> (9,1)
(6,2) -> (7,0)
(8,2) -> (9,0)
(11,0) -> (13,0)
(12,2) -> (13,1)
(13,2) -> (16,1) -> (18,1)
(14,0) -> (16,0) -> (20,0)
(14,2) -> (15,0)
(15,2) -> (19,1)
(16,2) -> (17,0)
(18,2) -> (19,0)
44 changes: 30 additions & 14 deletions examples/if_else.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,36 @@
DoubleGeneric<1>
DoubleGeneric<1,0,-1,0,1>
DoubleGeneric<1,0,0,0,-1>
DoubleGeneric<1,-1,-1>
DoubleGeneric<1,1,0,0,-1>
DoubleGeneric<0,0,0,1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,1,-1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,0,-1,0,1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<1,-1,-1>
DoubleGeneric<1,-1,-1>
DoubleGeneric<1,-1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,1,-1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,1,-1>
DoubleGeneric<0,0,-1,1>
DoubleGeneric<1,0,1>
DoubleGeneric<1,1,-1>
DoubleGeneric<1,0,0,0,-2>
(0,0) -> (1,0) -> (3,1) -> (7,1) -> (8,1)
(1,2) -> (7,0)
(2,0) -> (3,0)
(3,2) -> (5,1) -> (6,1)
(4,0) -> (6,2)
(4,1) -> (5,0) -> (9,0)
(7,2) -> (9,1)
(8,0) -> (10,0)
(8,2) -> (9,2)
(0,0) -> (1,0) -> (3,0) -> (11,0) -> (13,0)
(1,2) -> (12,0)
(2,0) -> (4,0)
(3,2) -> (4,1)
(4,2) -> (7,1) -> (9,1)
(5,0) -> (7,0) -> (15,0)
(5,2) -> (6,0)
(6,2) -> (10,1)
(7,2) -> (8,0)
(9,2) -> (10,0)
(11,2) -> (12,1)
(12,2) -> (15,1)
(13,2) -> (14,1)
(14,0) -> (18,0)
(14,2) -> (16,0)
(15,2) -> (17,0)
(16,2) -> (17,1)
Loading
Loading