complexity of circuit ideal membership testing · complexity of circuit ideal membership testing...

52
C OMPLEXITY OF C IRCUIT I DEAL MEMBERSHIP T ESTING Daniela Ritirc , Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria SC-Square Workshop 2017 University of Kaiserslautern, Germany 29. July 2017 DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Upload: others

Post on 17-Oct-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP

TESTING

Daniela Ritirc, Armin Biere, Manuel KauersJohannes Kepler University

Linz, Austria

SC-Square Workshop 2017University of Kaiserslautern, Germany

29. July 2017

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 2: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

MOTIVATION & SOLVING TECHNIQUES

Given: a (gate level) multiplier circuit Cfor fixed-size bitwidth n

FAFAFA

FAFAFA

FAFAFA

32s5 16s4 8s3 4s2 2s1 1s0+++++

0

0

0 00

0

a0b0a0b1a0b2

a1b0a1b1a1b2

a2b0a2b1a2b2

(4a2 + 2a1 + 1a0) ∗ (4b2 + 2b1 + 1b0)

Question: For all ai ,bi ∈ B:∑

2n−1i=0 2isi −

(∑

n−1i=0 2iai

)(∑

n−1i=0 2ibi

)?

Motivation

verify circuits to avoid issuseslike Pentium FDIV bug

Solving Techniques

SAT using CNF encoding

Binary Moment Diagrams(BMD)

Algebraic reasoning

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 3: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

MOTIVATION & SOLVING TECHNIQUES

SAT

verifying even small multipliers (16 Bit) is challenging (empirically)

conjecture [Biere’16]: even simple ring-properties, e.g., x · y = y · x ,require exponential sized resolution proofs (for gate-level CNF encoding)

recent theoretical result [BeameLiew’17]:polynomial sized resolution proofs for simple ring-properties exist

no theoretical nor practical results on general multiplier verification

BMD

approach not robust

requires structural knowledge

only works for simple (clean) multipliers

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 4: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

MOTIVATION & SOLVING TECHNIQUES

SAT

verifying even small multipliers (16 Bit) is challenging (empirically)

conjecture [Biere’16]: even simple ring-properties, e.g., x · y = y · x ,require exponential sized resolution proofs (for gate-level CNF encoding)

recent theoretical result [BeameLiew’17]:polynomial sized resolution proofs for simple ring-properties exist

no theoretical nor practical results on general multiplier verification

BMD

approach not robust

requires structural knowledge

only works for simple (clean) multipliers

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 5: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IN A NUTSHELL

Multiplier

FAFAFA

FAFAFA

FAFAFA

32s5 16s4 8s3 4s2 2s1 1s0+++++

0

0

0 00

0

a0b0a0b1a0b2

a1b0a1b1a1b2

a2b0a2b1a2b2

AIGMULTOPOLY

Translation

Gröbner basis

B = {x−a0 ∗b0,y−a1 ∗b1,s0− x ∗ y ,}

Verification

6= 0 7

= 0 3 CASys

tem

Reduc

tion

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 6: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IN A NUTSHELL

Multiplier

FAFAFA

FAFAFA

FAFAFA

32s5 16s4 8s3 4s2 2s1 1s0+++++

0

0

0 00

0

a0b0a0b1a0b2

a1b0a1b1a1b2

a2b0a2b1a2b2 AIGMULTOPOLY

Translation

Gröbner basis

B = {x−a0 ∗b0,y−a1 ∗b1,s0− x ∗ y ,}

Verification

6= 0 7

= 0 3 CASys

tem

Reduc

tion

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 7: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IN A NUTSHELL

Multiplier

FAFAFA

FAFAFA

FAFAFA

32s5 16s4 8s3 4s2 2s1 1s0+++++

0

0

0 00

0

a0b0a0b1a0b2

a1b0a1b1a1b2

a2b0a2b1a2b2 AIGMULTOPOLY

Translation

Gröbner basis

B = {x−a0 ∗b0,y−a1 ∗b1,s0− x ∗ y ,}

Verification

6= 0 7

= 0 3 CASys

tem

Reduc

tion

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 8: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

f = 2x +4y +3 ∈Q[x ,y ]g = y +1 ∈Q[x ,y ]

Ring Q[x ,y ]ring of polynomials with variables x ,y and coefficients in Q

Polynomial f ,gfinite sum of monomials

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 9: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

f = 2x +4y +3 ∈Q[x ,y ]g = y +1 ∈Q[x ,y ]

Monomialconstant multiple of a term

Termpower product xe1ye2 for e1,e2 ∈ N

Term orderwell-defined, x > y > 1

Leading monomial/term/coefficient

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 10: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

f = 2x +4y +3 ∈Q[x ,y ]g = y +1 ∈Q[x ,y ]

Ideal generated by f,gI = {q1f +q2g | q1,q2 ∈Q[x ,y ]}= 〈f ,g〉

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 11: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉

Ideal generated by f,gI = {q1f +q2g | q1,q2 ∈Q[x ,y ]}= 〈f ,g〉

“I contains all elements which evaluate to 0, when f and g evaluate to 0”

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 12: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +9 ∈ I ?

for I: a priori not obvious how to check thisfor a Gröbner basis G: “easy” reduction method really?

Gröbner basis

every ideal of Q[X ] has a Gröbner basisconstruction algorithm by Buchberger

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 13: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +9 ∈ I ?

for I: a priori not obvious how to check thisfor a Gröbner basis G: “easy” reduction method really?

Gröbner basis

every ideal of Q[X ] has a Gröbner basisconstruction algorithm by Buchberger

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 14: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +9 ∈ I ?

for I: a priori not obvious how to check thisfor a Gröbner basis G: “easy” reduction method really?

Gröbner basis

every ideal of Q[X ] has a Gröbner basisconstruction algorithm by Buchberger

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 15: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉

G = {2x +4y +3,y +1}

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +9 ∈ I ?

for I: a priori not obvious how to check thisfor a Gröbner basis G: “easy” reduction method really?

Gröbner basis

every ideal of Q[X ] has a Gröbner basisconstruction algorithm by Buchbergerspecial case:leading terms of ideal generators have no variables in common

G = {f ,g} is a Gröbner basis for I

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 16: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉G = {2x +4y +3,y +1}

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +9 ∈ I ?

for I: a priori not obvious how to check thisfor a Gröbner basis G: “easy” reduction method really?

Gröbner basis

every ideal of Q[X ] has a Gröbner basisconstruction algorithm by Buchbergerspecial case:leading terms of ideal generators have no variables in common

G = {f ,g} is a Gröbner basis for I

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 17: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉G = {2x +4y +3,y +1}

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +9 ∈ I ?

for I: a priori not obvious how to check thisfor a Gröbner basis G: “easy” reduction method really?

Reductionmultivariate version of polynomial division with remainder

divide h by elements of Gremainder r contains no term that is a multipleof any of the leading terms of GNotation: r = Remainder(h,G)

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 18: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉G = {2x +4y +3,y +1}

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +9 ∈ I ?

Answer: Yesh = 3∗ (2x +4y +3)+ y2 ∗ (y +1)Remainder(h,G)=0

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 19: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉G = {2x +4y +3,y +1}

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +9 ∈ I ?

Answer: Yesh = 3∗ (2x +4y +3)+ y2 ∗ (y +1)Remainder(h,G)=0

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 20: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉G = {2x +4y +3,y +1}

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +10 ∈ I ?

Answer: Noh = 3∗ (2x +4y +3)+ y2 ∗ (y +1)+1Remainder(h,G)=1

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 21: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

ALGEBRA

I = 〈f ,g〉= 〈2x +4y +3,y +1〉G = {2x +4y +3,y +1}

Ideal membership problemQuestion: h = 6x + y3 + y2 +12y +10 ∈ I ?

Answer: Noh = 3∗ (2x +4y +3)+ y2 ∗ (y +1)+1Remainder(h,G)=1

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 22: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

Polynomial Representation of Circuit Gates

Boolean Gate Polynomials

u = ¬v implies 0 =−u+1− vu = v ∧w implies 0 =−u+ vwu = v ∨w implies 0 =−u+ v +w− vwu = v⊕w implies 0 =−u+ v +w−2vw

Field Polynomials

“ u ∈ B ” implies 0 = u(u−1) 0 = u2−u

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 23: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

Polynomial Representation of Circuit Gates

Boolean Gate Polynomials

u = ¬v implies 0 =−u+1− vu = v ∧w implies 0 =−u+ vwu = v ∨w implies 0 =−u+ v +w− vwu = v⊕w implies 0 =−u+ v +w−2vw

Field Polynomials

“ u ∈ B ” implies 0 = u(u−1) 0 = u2−u

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 24: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

Polynomial Representation of Circuit Gates

Boolean Gate Polynomials

u = ¬v implies 0 =−u+1− vu = v ∧w implies 0 =−u+ vwu = v ∨w implies 0 =−u+ v +w− vwu = v⊕w implies 0 =−u+ v +w−2vw

Field Polynomials

“ u ∈ B ” implies 0 = u(u−1) 0 = u2−u

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 25: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

n-Bit Multipliers

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

n ∗n = 2n

2n inputs: a0, . . . ,an−1,b0, . . . ,bn−1

2n outputs: s0, . . . ,s2n−1

one variable to each internal gateoutput: g0, . . . ,gk

Values of g0, . . . ,gk and s0, . . . ,s2n−1 are uniquely determined as soon asa0, . . . ,an−1,b0, . . . ,bn−1 are fixed.

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 26: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

n-Bit Multipliers

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

n ∗n = 2n

2n inputs: a0, . . . ,an−1,b0, . . . ,bn−1

2n outputs: s0, . . . ,s2n−1

one variable to each internal gateoutput: g0, . . . ,gk

Values of g0, . . . ,gk and s0, . . . ,s2n−1 are uniquely determined as soon asa0, . . . ,an−1,b0, . . . ,bn−1 are fixed.

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 27: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

Polynomial Circuit Constraints

A polynomial p is called a polynomial circuit constraint (PCC) for a circuitC if for every choice of

(a0, . . . ,an−1,b0, . . . ,bn−1) ∈ {0,1}2n

and resulting values g1, . . . ,gk ,s0, . . . ,s2n−1 implied by the gates of C thesubstitution of these values into p gives zero.

The set of all PCCs for C is denoted by I(C).

I(C) is an ideal.

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 28: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

Polynomial Circuit Constraints

A polynomial p is called a polynomial circuit constraint (PCC) for a circuitC if for every choice of

(a0, . . . ,an−1,b0, . . . ,bn−1) ∈ {0,1}2n

and resulting values g1, . . . ,gk ,s0, . . . ,s2n−1 implied by the gates of C thesubstitution of these values into p gives zero.

The set of all PCCs for C is denoted by I(C).

I(C) is an ideal.

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 29: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

Examples for PCCs:

p0 = s0−a0b0 and gate

p1 = a21−a1 a1 boolean

p2 = g22−g2 g2 boolean

p3 = s1g4 xor-and constraint

. . .

A circuit C is called a multiplier if

2n−1

∑i=0

2isi −(n−1

∑i=0

2iai

)(n−1

∑i=0

2ibi

)∈ I(C).

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 30: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

Examples for PCCs:

p0 = s0−a0b0 and gate

p1 = a21−a1 a1 boolean

p2 = g22−g2 g2 boolean

p3 = s1g4 xor-and constraint

. . .

A circuit C is called a multiplier if

2n−1

∑i=0

2isi −(n−1

∑i=0

2iai

)(n−1

∑i=0

2ibi

)∈ I(C).

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 31: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

Problem: Definition of I(C) does not provide a basis

We can deduce at least some elements of I(C):

G = {Gate Polynomials}∪{Field Polynomials for inputs}The ideal generated by G is denoted by J(C).

Reverse topological order:output variable of a gate is greater than input variables→Then G is a Gröbner basis for J(C).

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 32: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

Problem: Definition of I(C) does not provide a basis

We can deduce at least some elements of I(C):

G = {Gate Polynomials}∪{Field Polynomials for inputs}The ideal generated by G is denoted by J(C).

Reverse topological order:output variable of a gate is greater than input variables→Then G is a Gröbner basis for J(C).

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 33: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

Problem: Definition of I(C) does not provide a basis

We can deduce at least some elements of I(C):

G = {Gate Polynomials}∪{Field Polynomials for inputs}The ideal generated by G is denoted by J(C).

Reverse topological order:output variable of a gate is greater than input variables→Then G is a Gröbner basis for J(C).

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 34: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

THEOREM

For all acyclic circuits C, we have J(C) = I(C).

J(C)⊆ I(C): corresponds to soundness

I(C)⊆ J(C): corresponds to completeness

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 35: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

THEOREM

For all acyclic circuits C, we have J(C) = I(C).

J(C)⊆ I(C): corresponds to soundness

I(C)⊆ J(C): corresponds to completeness

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 36: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

J(C) = 〈

−s3 +g1g4,−s2 +g1 +g4−2g1g4,−g4 +g2g3,−s1 +g2 +g3−2g2g3,−g1 +a1b1,−g2 +a0b1,−g3 +a1b0,−s0 +a0b0,−a2

1 +a1,−a20 +a0,

−b21 +b1,−b2

0 +b0〉

Order: s3 > s2 > g4 > s1 > g1 > g2 > g3 > s0 > a1 > a0 > b1 > b0

⇒ Generators of J(C) form a Gröbner basis

Question: 8s3 +4s2 +2s1 + s0− (2a1 +a0)(2b1 +b0) ∈ J(C)?

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 37: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

J(C) = 〈−s3 +g1g4,−s2 +g1 +g4−2g1g4,

−g4 +g2g3,−s1 +g2 +g3−2g2g3,−g1 +a1b1,−g2 +a0b1,−g3 +a1b0,−s0 +a0b0,−a2

1 +a1,−a20 +a0,

−b21 +b1,−b2

0 +b0〉

Order: s3 > s2 > g4 > s1 > g1 > g2 > g3 > s0 > a1 > a0 > b1 > b0

⇒ Generators of J(C) form a Gröbner basis

Question: 8s3 +4s2 +2s1 + s0− (2a1 +a0)(2b1 +b0) ∈ J(C)?

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 38: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

J(C) = 〈−s3 +g1g4,−s2 +g1 +g4−2g1g4,−g4 +g2g3,−s1 +g2 +g3−2g2g3,

−g1 +a1b1,−g2 +a0b1,−g3 +a1b0,−s0 +a0b0,−a2

1 +a1,−a20 +a0,

−b21 +b1,−b2

0 +b0〉

Order: s3 > s2 > g4 > s1 > g1 > g2 > g3 > s0 > a1 > a0 > b1 > b0

⇒ Generators of J(C) form a Gröbner basis

Question: 8s3 +4s2 +2s1 + s0− (2a1 +a0)(2b1 +b0) ∈ J(C)?

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 39: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

J(C) = 〈−s3 +g1g4,−s2 +g1 +g4−2g1g4,−g4 +g2g3,−s1 +g2 +g3−2g2g3,−g1 +a1b1,−g2 +a0b1,−g3 +a1b0,−s0 +a0b0,

−a21 +a1,−a2

0 +a0,−b2

1 +b1,−b20 +b0〉

Order: s3 > s2 > g4 > s1 > g1 > g2 > g3 > s0 > a1 > a0 > b1 > b0

⇒ Generators of J(C) form a Gröbner basis

Question: 8s3 +4s2 +2s1 + s0− (2a1 +a0)(2b1 +b0) ∈ J(C)?

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 40: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

J(C) = 〈−s3 +g1g4,−s2 +g1 +g4−2g1g4,−g4 +g2g3,−s1 +g2 +g3−2g2g3,−g1 +a1b1,−g2 +a0b1,−g3 +a1b0,−s0 +a0b0,−a2

1 +a1,−a20 +a0,

−b21 +b1,−b2

0 +b0〉

Order: s3 > s2 > g4 > s1 > g1 > g2 > g3 > s0 > a1 > a0 > b1 > b0

⇒ Generators of J(C) form a Gröbner basis

Question: 8s3 +4s2 +2s1 + s0− (2a1 +a0)(2b1 +b0) ∈ J(C)?

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 41: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

J(C) = 〈−s3 +g1g4,−s2 +g1 +g4−2g1g4,−g4 +g2g3,−s1 +g2 +g3−2g2g3,−g1 +a1b1,−g2 +a0b1,−g3 +a1b0,−s0 +a0b0,−a2

1 +a1,−a20 +a0,

−b21 +b1,−b2

0 +b0〉

Order: s3 > s2 > g4 > s1 > g1 > g2 > g3 > s0 > a1 > a0 > b1 > b0

⇒ Generators of J(C) form a Gröbner basis

Question: 8s3 +4s2 +2s1 + s0− (2a1 +a0)(2b1 +b0) ∈ J(C)?

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 42: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

IDEALS ASSOCIATED TO CIRCUITS

a1 b1 a0 b1 a1 b0 a0 b0

g1 g2 g3

g4

s0s1s2s3

J(C) = 〈−s3 +g1g4,−s2 +g1 +g4−2g1g4,−g4 +g2g3,−s1 +g2 +g3−2g2g3,−g1 +a1b1,−g2 +a0b1,−g3 +a1b0,−s0 +a0b0,−a2

1 +a1,−a20 +a0,

−b21 +b1,−b2

0 +b0〉

Order: s3 > s2 > g4 > s1 > g1 > g2 > g3 > s0 > a1 > a0 > b1 > b0

⇒ Generators of J(C) form a Gröbner basis

Question: 8s3 +4s2 +2s1 + s0− (2a1 +a0)(2b1 +b0) ∈ J(C)?

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 43: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY

COROLLARY

Checking non-ideal membership over Q[x1, . . . ,xn] even in terms of a givenGröbner basis is NP-hard.

Connection between circuit SAT and ideal membership testing

known (circuit) SAT circuit ideal membership claim

NP-complete SAT not constant → x ,x 6= 0 NP-hardCo-NP-complete UNSAT constant 0 → 0 Co-NP hard

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 44: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY

COROLLARY

Checking non-ideal membership over Q[x1, . . . ,xn] even in terms of a givenGröbner basis is NP-hard.

Connection between circuit SAT and ideal membership testing

known (circuit) SAT circuit ideal membership claim

NP-complete SAT not constant → x ,x 6= 0 NP-hardCo-NP-complete UNSAT constant 0 → 0 Co-NP hard

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 45: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY

COROLLARY

Checking non-ideal membership over Q[x1, . . . ,xn] even in terms of a givenGröbner basis is NP-hard.

Connection between circuit SAT and ideal membership testing

known (circuit) SAT circuit ideal membership claimNP-complete SAT not constant

→ x ,x 6= 0 NP-hardCo-NP-complete UNSAT constant 0 → 0 Co-NP hard

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 46: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY

COROLLARY

Checking non-ideal membership over Q[x1, . . . ,xn] even in terms of a givenGröbner basis is NP-hard.

Connection between circuit SAT and ideal membership testing

known (circuit) SAT circuit ideal membership claimNP-complete SAT not constant → x ,x 6= 0 NP-hard

Co-NP-complete UNSAT constant 0 → 0 Co-NP hard

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 47: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY

COROLLARY

Checking non-ideal membership over Q[x1, . . . ,xn] even in terms of a givenGröbner basis is NP-hard.

Connection between circuit SAT and ideal membership testing

known (circuit) SAT circuit ideal membership claimNP-complete SAT not constant → x ,x 6= 0 NP-hard

Co-NP-complete UNSAT constant 0

→ 0 Co-NP hard

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 48: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY

COROLLARY

Checking non-ideal membership over Q[x1, . . . ,xn] even in terms of a givenGröbner basis is NP-hard.

Connection between circuit SAT and ideal membership testing

known (circuit) SAT circuit ideal membership claimNP-complete SAT not constant → x ,x 6= 0 NP-hard

Co-NP-complete UNSAT constant 0 → 0 Co-NP hard

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 49: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY

NP-hard

transform circuit SAT problem into ideal non-membership testing

preserves NP-hardness

NP

open question: non-membership in NP (probably not)

h in ideal ⇔ h = ∑pi ∗gi for some pi (membership)

h not in ideal ⇔ h 6= ∑pi ∗gi for all pi (non-membership)sufficient condition for membership being in NP:

or equivalently non-membership in Co-NPpi can be restricted to have polynomial size (in our situation)but then NP = Co-NP

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 50: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY

NP-hard

transform circuit SAT problem into ideal non-membership testing

preserves NP-hardness

NP

open question: non-membership in NP (probably not)

h in ideal ⇔ h = ∑pi ∗gi for some pi (membership)

h not in ideal ⇔ h 6= ∑pi ∗gi for all pi (non-membership)sufficient condition for membership being in NP:

or equivalently non-membership in Co-NPpi can be restricted to have polynomial size (in our situation)but then NP = Co-NP

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 51: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

CONCLUSION & FUTURE WORK

Conclusion

simple and precise mathematical formulation

complexity result: circuit verification using computer algebra is hardresults part of an upcoming FMCAD’17 paper

with further experimental results anda novel column-wise incremental verification approach

Future Work

modular multiplication (32×32→ 32 multiplier)

algebraic specification of other arithmetic operators

algebraically verifying ring-properties

upper bounds

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING

Page 52: Complexity of Circuit Ideal Membership Testing · COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING Daniela Ritirc, Armin Biere, Manuel Kauers Johannes Kepler University Linz, Austria

COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP

TESTING

Daniela Ritirc, Armin Biere, Manuel KauersJohannes Kepler University

Linz, Austria

SC-Square Workshop 2017University of Kaiserslautern, Germany

29. July 2017

DANIELA RITIRC COMPLEXITY OF CIRCUIT IDEAL MEMBERSHIP TESTING