Positional Games and QBF The Corrective Encoding Abdallah Saffidine - - PowerPoint PPT Presentation

positional games and qbf
SMART_READER_LITE
LIVE PREVIEW

Positional Games and QBF The Corrective Encoding Abdallah Saffidine - - PowerPoint PPT Presentation

1/22 Positional Games and QBF The Corrective Encoding Abdallah Saffidine 1 Valentin Mayer-Eichberger 2 1 The University of New South Wales, Australia 2 Technische Universitaet Berlin, Germany 2/22 The rise of SAT Solvers Satisfiability solvers


slide-1
SLIDE 1

1/22

Positional Games and QBF

The Corrective Encoding Abdallah Saffidine 1 Valentin Mayer-Eichberger 2

1The University of New South Wales, Australia 2Technische Universitaet Berlin, Germany

slide-2
SLIDE 2

2/22

The rise of SAT Solvers

Satisfiability solvers can now be effectively deployed in practical applications.

  • S. Malik and L. Zhang. “Boolean satisfiability from

theoretical hardness to practical success”. In: Communications of the ACM 52.8 (2009), pp. 76–82

slide-3
SLIDE 3

2/22

The rise of SAT Solvers

Satisfiability solvers can now be effectively deployed in practical applications.

  • S. Malik and L. Zhang. “Boolean satisfiability from

theoretical hardness to practical success”. In: Communications of the ACM 52.8 (2009), pp. 76–82 Double-exponential is the new Polynomial That was a joke but. . . . . . maybe PSPACE is the new NP? . . . maybe QBF is the new SAT?

slide-4
SLIDE 4

3/22

Quantified Boolean Formulas

The prototypical PSPACE-complete problem. Example

∃x1∀y2∃x3∀y4∃x5(x1∨y2∨x3)∧(¬x3∨y4∨x5)∧(¬y2∨x5)

Game Semantics Two players Existential ∃ and Universal ∀ choose variables.

∃ tries to satisfy and ∀ tries to falsify.

Formula is true iff ∃ has a winning strategy. More natural than SAT for modeling Multi-Agent systems.

slide-5
SLIDE 5

4/22

Toby Walsh’s invited talk at SAT2003

Push QBF solvers research via a Connect 4 challenge

slide-6
SLIDE 6

5/22

Motivating related work

  • I. P

. Gent and A. G. D. Rowley. “Encoding Connect-4 Using Quantified Boolean Formulae”. In: Modelling and Reformulating Constraint Satisfaction Problems. 2003, pp. 78–93 A key part of our encoding are variables capturing the notion of a player “cheating” Diptarama et al. “QBF Encoding of Generalized Tic-Tac-Toe”. In: 4th International Workshop on Quantified Boolean Formulas. 2016, pp. 14–26 Also uses “cheat variables”

slide-7
SLIDE 7

6/22

The Game of Hex

slide-8
SLIDE 8

6/22

The Game of Hex

1

slide-9
SLIDE 9

6/22

The Game of Hex

1 2

slide-10
SLIDE 10

6/22

The Game of Hex

1 2 3

slide-11
SLIDE 11

6/22

The Game of Hex

1 2 3 4

slide-12
SLIDE 12

6/22

The Game of Hex

1 2 3 4 5

slide-13
SLIDE 13

6/22

The Game of Hex

1 2 3 4 5 6

slide-14
SLIDE 14

6/22

The Game of Hex

1 2 3 4 5 6 7

slide-15
SLIDE 15

7/22

Generalized Tic-Tac-Toe

slide-16
SLIDE 16

7/22

Generalized Tic-Tac-Toe

slide-17
SLIDE 17

7/22

Generalized Tic-Tac-Toe

slide-18
SLIDE 18

7/22

Generalized Tic-Tac-Toe

slide-19
SLIDE 19

7/22

Generalized Tic-Tac-Toe

slide-20
SLIDE 20

7/22

Generalized Tic-Tac-Toe

1

slide-21
SLIDE 21

7/22

Generalized Tic-Tac-Toe

1 2

slide-22
SLIDE 22

7/22

Generalized Tic-Tac-Toe

1 2 3

slide-23
SLIDE 23

7/22

Generalized Tic-Tac-Toe

1 2 3 4

slide-24
SLIDE 24

7/22

Generalized Tic-Tac-Toe

1 2 3 4 5

slide-25
SLIDE 25

7/22

Generalized Tic-Tac-Toe

1 2 3 4 5 6

slide-26
SLIDE 26

7/22

Generalized Tic-Tac-Toe

1 2 3 4 5 6 7

slide-27
SLIDE 27

7/22

Generalized Tic-Tac-Toe

1 2 3 4 5 6 7 8

slide-28
SLIDE 28

7/22

Generalized Tic-Tac-Toe

1 2 3 4 5 6 7 8 9

slide-29
SLIDE 29

7/22

Generalized Tic-Tac-Toe

1 2 3 4 5 6 7 8 9

slide-30
SLIDE 30

8/22

Positional Games Two players black (B) and white (W). Hypergraph H = (V,E) where hyperedges E = EB ∪EW are winning configurations. A player wins by claiming all vertices of a winning configuration before the opponent. Example Hex Tictactoe Chess (Different pieces) Go (Captures) Connect 4 (Gravity)

slide-31
SLIDE 31

9/22

TIC-TAC-TOE and its winning configurations.

a b c d e f g h i

{a,b,c},{d, e ,f }, {g,h, i },..., {a, e , i },{c, e ,g}

  • Winning sets: aligned triples

HEX and its winning configurations for Black.

d b g c h f a e i

{a,d,g},{a,d, e ,h}, {a,d, e ,f, i },{b,d,g}, {b, e ,g},...,{c,f, i }

  • Winning sets: NW-SE paths
slide-32
SLIDE 32

10/22

Main idea

One of the difficulties of the encoding How to map game moves to QBF moves? (ie, select a move → assign some variables to ⊤,⊥) Simple Solution For each move create a corresponding variable “this move was selected” Add clauses to prevent Black from chosing many moves per round. Add “cheating variables” to prevent White from chosing many moves per round.

slide-33
SLIDE 33

11/22

Main idea

One of the difficulties of the encoding How to map game moves to QBF moves? (ie, select a move → assign some variables to ⊤,⊥) Logarithmic idea Encode White moves logarithmically Avoid “cheating variables”!

slide-34
SLIDE 34

12/22

The New Encoding is smaller

Preprocessing on 5×5 instance gttt_1_1_00101121_5x5_b None Q H B QB BQ HQ QH DYS #qb 25 25 25 25 25 25 25 25 #∀ 300 300 300 299 299 299 300 300 #∃ 21056 12058 7553 2750 2605 2750 7553 7545 #cl 54k 36k 33k 21k 20k 19k 30k 30k #lits 191k 127k 145k 120k 107k 107k 103k 135k time(s) 46 1210 9 55 22 1233 2030 COR #qb 25 25 25 25 25 25 25 25 #∀ 60 60 58 58 58 58 58 58 #∃ 4649 3127 3433 1396 1360 1396 3432 2981 #cl 12k 8k 29k 8k 8k 7k 15k 20k #lits 29k 20k 118k 35k 34k 31k 52k 89k time(s) 275 2 2 2 277 20 Preprocessors: QratPre+ 2.0 (Q), HQSPRE 1.4 (H), Bloqqer v37 (B)

slide-35
SLIDE 35

12/22

The New Encoding is smaller

Preprocessing on 5×5 instance gttt_1_1_00101121_5x5_b None Q H B QB BQ HQ QH DYS #qb 25 25 25 25 25 25 25 25 #∀ 300 300 300 299 299 299 300 300 #∃ 21056 12058 7553 2750 2605 2750 7553 7545 #cl 54k 36k 33k 21k 20k 19k 30k 30k #lits 191k 127k 145k 120k 107k 107k 103k 135k time(s) 46 1210 9 55 22 1233 2030 COR #qb 25 25 25 25 25 25 25 25 #∀ 60 60 58 58 58 58 58 58 #∃ 4649 3127 3433 1396 1360 1396 3432 2981 #cl 12k 8k 29k 8k 8k 7k 15k 20k #lits 29k 20k 118k 35k 34k 31k 52k 89k time(s) 275 2 2 2 277 20 Preprocessors: QratPre+ 2.0 (Q), HQSPRE 1.4 (H), Bloqqer v37 (B)

slide-36
SLIDE 36

13/22

Solving GTTT 4×4

Solver Pre- Solve Fail1 Total time proc.

⊤ ⊥

h:mm:ss DYS Caqe 4.0.1 B 31 61 4 3:11:08 DepQbf 6.03 Q 28 54 14 7:33:31 Qesto 1.0 BQ 27 47 22 9:41:27 Qute 1.1 BQ 27 42 27 9:57:17 COR Caqe 4.0.1 Q 34 62 1:08:19 DepQbf 6.03 N 34 62 0:10:02 Qesto 1.0 BQ 34 62 0:56:44 Qute 1.1 B 30 52 14 6:27:46

1Timeout: 1000 seconds per instance

slide-37
SLIDE 37

14/22

Case study: GTTT 5×5, L-shape

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

slide-38
SLIDE 38

14/22

Case study: GTTT 5×5, L-shape

1

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

slide-39
SLIDE 39

14/22

Case study: GTTT 5×5, L-shape

1 2

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

slide-40
SLIDE 40

14/22

Case study: GTTT 5×5, L-shape

1 2

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours

slide-41
SLIDE 41

14/22

Case study: GTTT 5×5, L-shape

1 2 3

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours

slide-42
SLIDE 42

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours

slide-43
SLIDE 43

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674.

slide-44
SLIDE 44

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674.

slide-45
SLIDE 45

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674.

slide-46
SLIDE 46

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927.

slide-47
SLIDE 47

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927.

slide-48
SLIDE 48

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927.

slide-49
SLIDE 49

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0

slide-50
SLIDE 50

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0

slide-51
SLIDE 51

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0

slide-52
SLIDE 52

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52

slide-53
SLIDE 53

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52

slide-54
SLIDE 54

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11 12

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52

slide-55
SLIDE 55

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11 12

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52 12 7 0.03 0.09

slide-56
SLIDE 56

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11 12 13

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52 12 7 0.03 0.09

slide-57
SLIDE 57

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11 12 13 14

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52 12 7 0.03 0.09 . . . . . . . . . . . .

slide-58
SLIDE 58

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52 12 7 0.03 0.09 . . . . . . . . . . . .

slide-59
SLIDE 59

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52 12 7 0.03 0.09 . . . . . . . . . . . .

slide-60
SLIDE 60

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52 12 7 0.03 0.09 . . . . . . . . . . . .

slide-61
SLIDE 61

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52 12 7 0.03 0.09 . . . . . . . . . . . .

slide-62
SLIDE 62

14/22

Case study: GTTT 5×5, L-shape

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Time (s) needed to establish if Black can win within depth ≤ d after k stones are played. k d

| = φk

d−2

| = φk

d

2 13 1942. > 8 hours 4 13 239. 1674. 6 13 80.3 927. 8 11 2.16 18.0 10 9 0.05 1.52 12 7 0.03 0.09 . . . . . . . . . . . .

slide-63
SLIDE 63

15/22

HEX Puzzles from the 1940s

slide-64
SLIDE 64

16/22

Solving classic HEX puzzles by encoding them through COR.

Puzzle size depth caqe-Q depqbf-N questo-BQ d

| = φd−2 | = φd | = φd−2 | = φd | = φd−2 | = φd

Hein 04 3x3 05 0.01 0.01 0.02 0.02 0.01 0.00 Hein 09 4x4 07 0.01 0.11 0.03 0.15 0.01 0.06 Hein 12 4x4 07 0.02 0.10 0.05 0.22 0.00 0.02 Hein 07 4x4 09 0.30 4.31 0.33 5.69 0.09 1.66 Hein 06 4x4 13 10.2 15.5 2.95 17.7 3.92 9.79 Hein 13 5x5 09 0.24 15.6 0.72 17.1 0.06 4.61 Hein 14 5x5 09 0.38 19.0 1.24 42.4 0.18 4.40 Hein 11 5x5 11 5.17 240. 21.0 457. 1.84 23.6 Hein 19 5x5 11 2.29 44.4 3.60 80.8 0.91 13.1 Hein 08 5x5 11 4.13 104. 6.84 247.0 1.98 34.4 Hein 10 5x5 13 367. 4906. 443. 10259. 74.3 1543. Hein 16 5x5 13 651. 8964. 1794. 8506. 278. 4406. Hein 02 5x5 13 719. 22526. 1258. 10876. 317. 2957. Hein 15 5x5 15 3247. 26938. 2928. 19469. 767. MO Browne 5x5 09 0.87 57.45 0.91 21.2 0.25 2.89

slide-65
SLIDE 65

17/22

Towards full-scale: Qubic

slide-66
SLIDE 66

18/22

Towards full-scale: Gomoku (Renju)

Aldis Reims vs Arnis Veidemanis World Championship in Tallinn, Estonia 1995

slide-67
SLIDE 67

19/22

Towards full-scale: GTTT with 6 cells

slide-68
SLIDE 68

20/22

Milestone problems

Challenge problem First systematic solution Size in QBF Domain Variant #qb # ∀ # ∃ #cl #lits QUBIC 4×4×4 1980 65 192 29k 80k 246k SNAKY 9×9

  • pen

81 280 47k 131k 404k GOMOKU 15×152 1993 225 896 357k 991k 3078k CONNECT6 19×193 2010 179 1602 511k 1527k 5031k

2Freestyle 3Mickey Mouse opening

slide-69
SLIDE 69

21/22

Contributions QBF encoding from positional games. Improved upon previous encodings by a simpler and more compact encoding. Implementation available. We can demonstrate this improvement by experiments. Improvements over DYS GTTT encoding 5× more compact encoding of tiny problems 30× faster solving of tiny problems Can solve “small” problems More general encoding (positional games)

slide-70
SLIDE 70

22/22

For the first time, automated Hex solvers have surpassed humans [...]: they can now solve many 9×9 Hex openings.

  • B. Arneson et al. “Solving hex: beyond humans”. In:

Computers and Games. 2010, pp. 1–10

4

slide-71
SLIDE 71

22/22

For the first time, automated Hex solvers have surpassed humans [...]: they can now solve many 9×9 Hex openings.

  • B. Arneson et al. “Solving hex: beyond humans”. In:

Computers and Games. 2010, pp. 1–10 For the first time, QBF-based solvers have surpassed total beginners: they can now solve 5×5 Hex and Tic-Tac-Toe puzzles.

  • V. Mayer-Eichberger and A. Saffidine. “QBF solving
  • f positional games: beyond trivial”. In: SAT. 20204

4Not the published title, but that’s the spirit!