SyMT: finding symmetries in SMT formulas (Work in progress) Carlos - - PowerPoint PPT Presentation

symt finding symmetries in smt formulas
SMART_READER_LITE
LIVE PREVIEW

SyMT: finding symmetries in SMT formulas (Work in progress) Carlos - - PowerPoint PPT Presentation

SyMT: finding symmetries in SMT formulas (Work in progress) Carlos Areces, David Dharbe, Pascal Fontaine , and Ezequiel Orbe UFRN (Natal, Brazil) Loria, INRIA, Universit de Nancy (France) FaMaF (Crdoba, Argentina) SMT, July 8-9, 2013


slide-1
SLIDE 1

SyMT: finding symmetries in SMT formulas

(Work in progress)

Carlos Areces, David Déharbe, Pascal Fontaine, and Ezequiel Orbe

UFRN (Natal, Brazil) Loria, INRIA, Université de Nancy (France) FaMaF (Córdoba, Argentina)

SMT, July 8-9, 2013

SMT, July 8-9, 2013 1 / 17

slide-2
SLIDE 2

Introduction

Outline

1

Introduction

2

Symmetry breaking: previous technique

3

Finding symmetries with graph isomorphism tools

4

Teaser

5

Conclusion

SMT, July 8-9, 2013 2 / 17

slide-3
SLIDE 3

Introduction

Introduction

Satisfiability solving: problem encoding of primal importance doing many times the same thing is a waste of time Previously (CADE 2011): breaking symmetries on QF_UF gives impressive results In this talk: beyond tailored heuristics generalize symmetry finding

SMT, July 8-9, 2013 3 / 17

slide-4
SLIDE 4

Symmetry breaking: previous technique

Outline

1

Introduction

2

Symmetry breaking: previous technique

3

Finding symmetries with graph isomorphism tools

4

Teaser

5

Conclusion

SMT, July 8-9, 2013 4 / 17

slide-5
SLIDE 5

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-6
SLIDE 6

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-7
SLIDE 7

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p2 = B2 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-8
SLIDE 8

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p2 = B2, p3 = B3 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-9
SLIDE 9

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p2 = B2, p3 = B3, p4 =? Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-10
SLIDE 10

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p2 = B2, p3 = B3 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-11
SLIDE 11

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p2 = B2 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-12
SLIDE 12

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p2 = B2, p4 = B3 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-13
SLIDE 13

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p2 = B2, p4 = B3, p3 =? Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-14
SLIDE 14

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p2 = B2, p4 = B3 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-15
SLIDE 15

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p2 = B2 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-16
SLIDE 16

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-17
SLIDE 17

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1, p3 = B2 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-18
SLIDE 18

Symmetry breaking: previous technique

Symmetry breaking: break a factorial

4 distinct pigeons: p1 = p2 ∧ p1 = p3 ∧ p1 = p4∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 every pigeon in a hole: p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 Let’s satisfy every clause: p1 = B1 Whatever the colors, there will always be one pigeon out symmetries imply many similar reasoning paths detecting symmetries a priori: search one path out of many large decrease of search space, large decrease in solving times

SMT, July 8-9, 2013 5 / 17

slide-19
SLIDE 19

Symmetry breaking: previous technique

Previous technique

The formula:

p1 = p2 ∧ p1 = p3 ∧ p1 = p4 ∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 p1 = B1 p2 = B2

B1, B2, B3 appear the same number of times, in the same number

  • f clauses,. . .

formula preserved by permutation of B1, B2, B3 (∨, ∧ commutative) p1 = B1 ∨ p1 = B2 ∨ p1 = B3 holds, so let’s say p1 = B1 resulting formula is still symmetric w.r.t. B2, B3. Repeat

SMT, July 8-9, 2013 6 / 17

slide-20
SLIDE 20

Symmetry breaking: previous technique

Previous technique

The formula:

p1 = p2 ∧ p1 = p3 ∧ p1 = p4 ∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 p1 = B1 p2 = B2

B1, B2, B3 appear the same number of times, in the same number

  • f clauses,. . .

formula preserved by permutation of B1, B2, B3 (∨, ∧ commutative) p1 = B1 ∨ p1 = B2 ∨ p1 = B3 holds, so let’s say p1 = B1 resulting formula is still symmetric w.r.t. B2, B3. Repeat

SMT, July 8-9, 2013 6 / 17

slide-21
SLIDE 21

Symmetry breaking: previous technique

Previous technique

The formula:

p1 = p2 ∧ p1 = p3 ∧ p1 = p4 ∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 p1 = B1 p2 = B2

B1, B2, B3 appear the same number of times, in the same number

  • f clauses,. . .

formula preserved by permutation of B1, B2, B3 (∨, ∧ commutative) p1 = B1 ∨ p1 = B2 ∨ p1 = B3 holds, so let’s say p1 = B1 resulting formula is still symmetric w.r.t. B2, B3. Repeat

SMT, July 8-9, 2013 6 / 17

slide-22
SLIDE 22

Symmetry breaking: previous technique

Previous technique

The formula:

p1 = p2 ∧ p1 = p3 ∧ p1 = p4 ∧ p2 = p3 ∧ p2 = p4 ∧ p3 = p4 p1 = B1 ∨ p1 = B2 ∨ p1 = B3 p2 = B1 ∨ p2 = B2 ∨ p2 = B3 p3 = B1 ∨ p3 = B2 ∨ p3 = B3 p4 = B1 ∨ p4 = B2 ∨ p4 = B3 p1 = B1 p2 = B2

B1, B2, B3 appear the same number of times, in the same number

  • f clauses,. . .

formula preserved by permutation of B1, B2, B3 (∨, ∧ commutative) p1 = B1 ∨ p1 = B2 ∨ p1 = B3 holds, so let’s say p1 = B1 resulting formula is still symmetric w.r.t. B2, B3. Repeat

SMT, July 8-9, 2013 6 / 17

slide-23
SLIDE 23

Symmetry breaking: previous technique

Previous technique: weaknesses

Besides being sensitive to obfuscation:

finding symmetries highly heuristic: guess, and then check symmetry symmetry breaking tailored to special case: not easily generalizable

But impressive improvements on QF_UF: worth trying to extend Goal: being more general in finding and breaking symmetries

SMT, July 8-9, 2013 7 / 17

slide-24
SLIDE 24

Finding symmetries with graph isomorphism tools

Outline

1

Introduction

2

Symmetry breaking: previous technique

3

Finding symmetries with graph isomorphism tools

4

Teaser

5

Conclusion

SMT, July 8-9, 2013 8 / 17

slide-25
SLIDE 25

Finding symmetries with graph isomorphism tools

Finding symmetries: graph isomorphism

Graph isomorphism problem Finding non trivial renaming of nodes resulting in isomorphic graph graph isomorphism finding is in NP . P? NPC? efficient algorithms exist (time never an issue in our experiments) formulas: not exactly graphs, but can easily be translated btw, isomorphism finding for DAGs is not simpler good tools: saucy, bliss

SMT, July 8-9, 2013 9 / 17

slide-26
SLIDE 26

Finding symmetries with graph isomorphism tools

Finding symmetries: from formulas to (acyclic) graphs

p(f(a, b)) ∨ p(f(b, a)) ∨ p(g(a, b)) ∨ p(g(b, a))

node colored by (HOL) sort node for every symbol node for each subterm special nodes “0” for lists of terms node for term linked to top symbol and list of subterms commutative symbols: directly link to subterms maximal sharing

11, or 1 1 1 1 1 9, p 8 8 8 8 10, f 10, g 8, a 8, b

Graph isomorphic iff formula symmetric

SMT, July 8-9, 2013 10 / 17

slide-27
SLIDE 27

Finding symmetries with graph isomorphism tools

Finding symmetries: the tool

parse formula simplify (several options) graph isomorphism tool: saucy, bliss

  • utput group generators

./SyMT -enable-simp smt-lib2/QF_UF/NEQ/NEQ004_size4.smt2 (p7 p9)(c12 c13) (c_3 c_1) (c_2 c_1) (c_0 c_1)

SMT, July 8-9, 2013 11 / 17

slide-28
SLIDE 28

Finding symmetries with graph isomorphism tools

SMT-LIB and symmetries

Category #Inst #Sym[P] Avg[GS] Time AUFLIA 6480 6258 134.00 378.79 AUFLIRA 19917 16476 1.08 9.13 AUFNIRA 989 985 1.00 0.41 QF_AUFLIA 1140 78 1.00 0.72 QF_AX 551 22 1.00 0.37 QF_IDL 1749 756 12745.43 327.95 QF_LIA 5938 1200 104.55 486.19 QF_LRA 634 210 110.49 29.06 QF_NIA 530 169 5.92 3.92 QF_NRA 166 43 1.00 0.23 QF_RDL 204 24 0.00 10.13 QF_UF 6639 3638 44.00 34.58 QF_UFIDL 431 189 1.00 2.70 QF_UFLIA 564 198 0.00 0.45 UFNIA 1796 1070 47.08 543.26

SMT, July 8-9, 2013 12 / 17

slide-29
SLIDE 29

Teaser

Outline

1

Introduction

2

Symmetry breaking: previous technique

3

Finding symmetries with graph isomorphism tools

4

Teaser

5

Conclusion

SMT, July 8-9, 2013 13 / 17

slide-30
SLIDE 30

Teaser

Teaser: symmetry simplification

Issues with symmetries: graph isomorphism tools provide (small number of) generators maybe redundant even if. . . . . . some kind of non redundancy property holds figuring out what generators mean can be difficult Work in progress: simplify generators identify subgroups that are full permutation groups on some symbols computational group theory: Schreier-Sims (polynomial) E.g.

./SyMT -enable-simp smt-lib2/QF_UF/NEQ/NEQ004_size4.smt2 (p7 p9)(c12 c13) (c_3 c_1) (c_2 c_1) (c_0 c_1)

SMT, July 8-9, 2013 14 / 17

slide-31
SLIDE 31

Teaser

Teaser: symmetry simplification

Issues with symmetries: graph isomorphism tools provide (small number of) generators maybe redundant even if. . . . . . some kind of non redundancy property holds figuring out what generators mean can be difficult Work in progress: simplify generators identify subgroups that are full permutation groups on some symbols computational group theory: Schreier-Sims (polynomial) E.g.

./SyMT -enable-simp smt-lib2/QF_UF/NEQ/NEQ004_size4.smt2 (p7 p9)(c12 c13) [c_0 c_1 c_2 c_3]

SMT, July 8-9, 2013 14 / 17

slide-32
SLIDE 32

Teaser

Teaser: symmetry breaking

Symmetry breaking for propositional logic? Set of formulas: ψi,σ =def

1≤j<i

pj ≡ pjσ

  • ⇒ (pi ⇒ piσ).

assuming an order on propositional variables SBP on SAT: large, need advanced techniques working on recasting to SMT SMT symmetries are more “structural” hopefully easier to break efficiently (?) Symmetry breaking for SMT unifies several heuristics, e.g. diamonds

SMT, July 8-9, 2013 15 / 17

slide-33
SLIDE 33

Conclusion

Outline

1

Introduction

2

Symmetry breaking: previous technique

3

Finding symmetries with graph isomorphism tools

4

Teaser

5

Conclusion

SMT, July 8-9, 2013 16 / 17

slide-34
SLIDE 34

Conclusion

Conclusion

symmetry-based techniques sensitive to obfuscation users should break their symmetries themselves, i.e. generate symmetry-free formulas SyMT, a tool to find out symmetries in the near future, SyMT will provide hints for symmetry breaking predicates

  • pen-source (w.i.p.). http://www.veriT-solver.org

SMT, July 8-9, 2013 17 / 17