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

ccs.GetConstraints readable output #244

Merged
merged 9 commits into from
Jan 28, 2022
12 changes: 6 additions & 6 deletions debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ func TestTraceDivBy0(t *testing.T) {
{
_, err := getGroth16Trace(&circuit, &witness)
assert.Error(err)
assert.Contains(err.Error(), "constraint is not satisfied: [div] 2/(-2 + 2) == <unsolved>")
assert.Contains(err.Error(), "constraint #0 is not satisfied: [div] 2/(-2 + 2) == <unsolved>")
assert.Contains(err.Error(), "(*divBy0Trace).Define")
assert.Contains(err.Error(), "debug_test.go:")
}

{
_, err := getPlonkTrace(&circuit, &witness)
assert.Error(err)
assert.Contains(err.Error(), "constraint is not satisfied: [inverse] 1/0 < ∞")
assert.Contains(err.Error(), "constraint #1 is not satisfied: [inverse] 1/0 < ∞")
assert.Contains(err.Error(), "(*divBy0Trace).Define")
assert.Contains(err.Error(), "debug_test.go:")
}
Expand Down Expand Up @@ -120,15 +120,15 @@ func TestTraceNotEqual(t *testing.T) {
{
_, err := getGroth16Trace(&circuit, &witness)
assert.Error(err)
assert.Contains(err.Error(), "constraint is not satisfied: [assertIsEqual] 1 == (24 + 42)")
assert.Contains(err.Error(), "constraint #0 is not satisfied: [assertIsEqual] 1 == (24 + 42)")
assert.Contains(err.Error(), "(*notEqualTrace).Define")
assert.Contains(err.Error(), "debug_test.go:")
}

{
_, err := getPlonkTrace(&circuit, &witness)
assert.Error(err)
assert.Contains(err.Error(), "constraint is not satisfied: [assertIsEqual] 1 + -66 == 0")
assert.Contains(err.Error(), "constraint #1 is not satisfied: [assertIsEqual] 1 + -66 == 0")
assert.Contains(err.Error(), "(*notEqualTrace).Define")
assert.Contains(err.Error(), "debug_test.go:")
}
Expand Down Expand Up @@ -157,15 +157,15 @@ func TestTraceNotBoolean(t *testing.T) {
{
_, err := getGroth16Trace(&circuit, &witness)
assert.Error(err)
assert.Contains(err.Error(), "constraint is not satisfied: [assertIsBoolean] (24 + 42) == (0|1)")
assert.Contains(err.Error(), "constraint #0 is not satisfied: [assertIsBoolean] (24 + 42) == (0|1)")
assert.Contains(err.Error(), "(*notBooleanTrace).Define")
assert.Contains(err.Error(), "debug_test.go:")
}

{
_, err := getPlonkTrace(&circuit, &witness)
assert.Error(err)
assert.Contains(err.Error(), "constraint is not satisfied: [assertIsBoolean] 66 == (0|1)")
assert.Contains(err.Error(), "constraint #1 is not satisfied: [assertIsBoolean] 66 == (0|1)")
assert.Contains(err.Error(), "(*notBooleanTrace).Define")
assert.Contains(err.Error(), "debug_test.go:")
}
Expand Down
3 changes: 0 additions & 3 deletions frontend/ccs.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ type CompiledConstraintSystem interface {
CurveID() ecc.ID
FrSize() int

// ToHTML generates a human readable representation of the constraint system
ToHTML(w io.Writer) error

// GetCounters return the collected constraint counters, if any
GetCounters() []compiled.Counter

Expand Down
86 changes: 5 additions & 81 deletions internal/backend/bls12-377/cs/r1cs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 73 additions & 60 deletions internal/backend/bls12-377/cs/r1cs_sparse.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions internal/backend/bls12-377/cs/solution.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading