src/HOL/ex/Sudoku.thy
author wenzelm
Sun, 02 Nov 2014 18:21:45 +0100
changeset 58889 5b7a9633cfa8
parent 58310 91ea607a34d8
child 61343 5b5656a63bd6
permissions -rw-r--r--
modernized header uniformly as section;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41589
bbd861837ebc tuned headers;
wenzelm
parents: 35416
diff changeset
     1
(*  Title:      HOL/ex/Sudoku.thy
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
     2
    Author:     Tjark Weber
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
     3
    Copyright   2005-2014
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
     4
*)
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
     5
58889
5b7a9633cfa8 modernized header uniformly as section;
wenzelm
parents: 58310
diff changeset
     6
section {* A SAT-based Sudoku Solver *}
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
     7
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
     8
theory Sudoku
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
     9
imports Main
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    10
begin
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    11
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    12
text {*
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
    13
  See the paper ``A SAT-based Sudoku Solver'' (Tjark Weber, published at
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
    14
  LPAR'05) for further explanations.  (The paper describes an older version of
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
    15
  this theory that used the model finder @{text refute} to find Sudoku
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
    16
  solutions.  The @{text refute} tool has since been superseded by
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
    17
  @{text nitpick}, which is used below.)
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
    18
*}
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    19
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
    20
no_notation Groups.one_class.one ("1")
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    21
58310
91ea607a34d8 updated news
blanchet
parents: 58183
diff changeset
    22
datatype digit = A ("1") | B ("2") | C ("3") | D ("4") | E ("5") | F ("6") | G ("7") | H ("8") | I ("9")
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    23
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 28949
diff changeset
    24
definition valid :: "digit => digit => digit => digit => digit => digit => digit => digit => digit => bool" where
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    25
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    26
  "valid x1 x2 x3 x4 x5 x6 x7 x8 x9 ==
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    27
    (x1 \<noteq> x2) \<and> (x1 \<noteq> x3) \<and> (x1 \<noteq> x4) \<and> (x1 \<noteq> x5) \<and> (x1 \<noteq> x6) \<and> (x1 \<noteq> x7) \<and> (x1 \<noteq> x8) \<and> (x1 \<noteq> x9)
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    28
    \<and> (x2 \<noteq> x3) \<and> (x2 \<noteq> x4) \<and> (x2 \<noteq> x5) \<and> (x2 \<noteq> x6) \<and> (x2 \<noteq> x7) \<and> (x2 \<noteq> x8) \<and> (x2 \<noteq> x9)
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    29
    \<and> (x3 \<noteq> x4) \<and> (x3 \<noteq> x5) \<and> (x3 \<noteq> x6) \<and> (x3 \<noteq> x7) \<and> (x3 \<noteq> x8) \<and> (x3 \<noteq> x9)
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    30
    \<and> (x4 \<noteq> x5) \<and> (x4 \<noteq> x6) \<and> (x4 \<noteq> x7) \<and> (x4 \<noteq> x8) \<and> (x4 \<noteq> x9)
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    31
    \<and> (x5 \<noteq> x6) \<and> (x5 \<noteq> x7) \<and> (x5 \<noteq> x8) \<and> (x5 \<noteq> x9)
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    32
    \<and> (x6 \<noteq> x7) \<and> (x6 \<noteq> x8) \<and> (x6 \<noteq> x9)
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    33
    \<and> (x7 \<noteq> x8) \<and> (x7 \<noteq> x9)
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    34
    \<and> (x8 \<noteq> x9)"
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    35
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 28949
diff changeset
    36
definition sudoku :: "digit => digit => digit => digit => digit => digit => digit => digit => digit =>
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    37
    digit => digit => digit => digit => digit => digit => digit => digit => digit =>
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    38
    digit => digit => digit => digit => digit => digit => digit => digit => digit =>
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    39
    digit => digit => digit => digit => digit => digit => digit => digit => digit =>
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    40
    digit => digit => digit => digit => digit => digit => digit => digit => digit =>
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    41
    digit => digit => digit => digit => digit => digit => digit => digit => digit =>
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    42
    digit => digit => digit => digit => digit => digit => digit => digit => digit =>
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    43
    digit => digit => digit => digit => digit => digit => digit => digit => digit =>
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 28949
diff changeset
    44
    digit => digit => digit => digit => digit => digit => digit => digit => digit => bool" where
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    45
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    46
  "sudoku x11 x12 x13 x14 x15 x16 x17 x18 x19
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    47
          x21 x22 x23 x24 x25 x26 x27 x28 x29
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    48
          x31 x32 x33 x34 x35 x36 x37 x38 x39
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    49
          x41 x42 x43 x44 x45 x46 x47 x48 x49
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    50
          x51 x52 x53 x54 x55 x56 x57 x58 x59
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    51
          x61 x62 x63 x64 x65 x66 x67 x68 x69
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    52
          x71 x72 x73 x74 x75 x76 x77 x78 x79
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    53
          x81 x82 x83 x84 x85 x86 x87 x88 x89
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    54
          x91 x92 x93 x94 x95 x96 x97 x98 x99 ==
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    55
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    56
       valid x11 x12 x13 x14 x15 x16 x17 x18 x19
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    57
     \<and> valid x21 x22 x23 x24 x25 x26 x27 x28 x29
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    58
     \<and> valid x31 x32 x33 x34 x35 x36 x37 x38 x39
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    59
     \<and> valid x41 x42 x43 x44 x45 x46 x47 x48 x49
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    60
     \<and> valid x51 x52 x53 x54 x55 x56 x57 x58 x59
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    61
     \<and> valid x61 x62 x63 x64 x65 x66 x67 x68 x69
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    62
     \<and> valid x71 x72 x73 x74 x75 x76 x77 x78 x79
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    63
     \<and> valid x81 x82 x83 x84 x85 x86 x87 x88 x89
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    64
     \<and> valid x91 x92 x93 x94 x95 x96 x97 x98 x99
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    65
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    66
     \<and> valid x11 x21 x31 x41 x51 x61 x71 x81 x91
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    67
     \<and> valid x12 x22 x32 x42 x52 x62 x72 x82 x92
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    68
     \<and> valid x13 x23 x33 x43 x53 x63 x73 x83 x93
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    69
     \<and> valid x14 x24 x34 x44 x54 x64 x74 x84 x94
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    70
     \<and> valid x15 x25 x35 x45 x55 x65 x75 x85 x95
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    71
     \<and> valid x16 x26 x36 x46 x56 x66 x76 x86 x96
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    72
     \<and> valid x17 x27 x37 x47 x57 x67 x77 x87 x97
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    73
     \<and> valid x18 x28 x38 x48 x58 x68 x78 x88 x98
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    74
     \<and> valid x19 x29 x39 x49 x59 x69 x79 x89 x99
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    75
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    76
     \<and> valid x11 x12 x13 x21 x22 x23 x31 x32 x33
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    77
     \<and> valid x14 x15 x16 x24 x25 x26 x34 x35 x36
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    78
     \<and> valid x17 x18 x19 x27 x28 x29 x37 x38 x39
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    79
     \<and> valid x41 x42 x43 x51 x52 x53 x61 x62 x63
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    80
     \<and> valid x44 x45 x46 x54 x55 x56 x64 x65 x66
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    81
     \<and> valid x47 x48 x49 x57 x58 x59 x67 x68 x69
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    82
     \<and> valid x71 x72 x73 x81 x82 x83 x91 x92 x93
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    83
     \<and> valid x74 x75 x76 x84 x85 x86 x94 x95 x96
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    84
     \<and> valid x77 x78 x79 x87 x88 x89 x97 x98 x99"
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    85
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    86
text {*
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    87
  Just an arbitrary Sudoku grid:
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    88
*}
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    89
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    90
theorem "\<not> sudoku
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    91
    x11 x12 x13 x14 x15 x16 x17 x18 x19
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    92
    x21 x22 x23 x24 x25 x26 x27 x28 x29
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    93
    x31 x32 x33 x34 x35 x36 x37 x38 x39
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    94
    x41 x42 x43 x44 x45 x46 x47 x48 x49
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    95
    x51 x52 x53 x54 x55 x56 x57 x58 x59
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    96
    x61 x62 x63 x64 x65 x66 x67 x68 x69
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    97
    x71 x72 x73 x74 x75 x76 x77 x78 x79
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    98
    x81 x82 x83 x84 x85 x86 x87 x88 x89
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
    99
    x91 x92 x93 x94 x95 x96 x97 x98 x99"
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   100
  nitpick [expect=genuine]
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   101
oops
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   102
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   103
text {*
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   104
  An ``easy'' Sudoku:
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   105
*}
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   106
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   107
theorem "\<not> sudoku
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   108
     5   3  x13 x14  7  x16 x17 x18 x19
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   109
     6  x22 x23  1   9   5  x27 x28 x29
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   110
    x31  9   8  x34 x35 x36 x37  6  x39
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   111
     8  x42 x43 x44  6  x46 x47 x48  3 
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   112
     4  x52 x53  8  x55  3  x57 x58  1 
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   113
     7  x62 x63 x64  2  x66 x67 x68  6 
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   114
    x71  6  x73 x74 x75 x76  2   8  x79
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   115
    x81 x82 x83  4   1   9  x87 x88  5 
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   116
    x91 x92 x93 x94  8  x96 x97  7   9 "
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   117
  nitpick [expect=genuine]
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   118
oops
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   119
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   120
text {*
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   121
  A ``hard'' Sudoku:
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   122
*}
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   123
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   124
theorem "\<not> sudoku
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   125
    x11  2  x13 x14 x15 x16 x17 x18 x19
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   126
    x21 x22 x23  6  x25 x26 x27 x28  3 
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   127
    x31  7   4  x34  8  x36 x37 x38 x39
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   128
    x41 x42 x43 x44 x45  3  x47 x48  2 
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   129
    x51  8  x53 x54  4  x56 x57  1  x59
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   130
     6  x62 x63  5  x65 x66 x67 x68 x69
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   131
    x71 x72 x73 x74  1  x76  7   8  x79
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   132
     5  x82 x83 x84 x85  9  x87 x88 x89
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   133
    x91 x92 x93 x94 x95 x96 x97  4  x99"
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   134
  nitpick [expect=genuine]
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   135
oops
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   136
28949
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   137
text {*
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   138
  Some ``exceptionally difficult'' Sudokus, taken from
54703
499f92dc6e45 more antiquotations;
wenzelm
parents: 41589
diff changeset
   139
  @{url "http://en.wikipedia.org/w/index.php?title=Algorithmics_of_sudoku&oldid=254685903"}
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   140
  (accessed December~2, 2008).
28949
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   141
*}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   142
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   143
text {*
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   144
\begin{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   145
Rating Program: gsf's sudoku q1 (rating) 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   146
Rating: 99408 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   147
Poster: JPF 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   148
Label: Easter Monster 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   149
1.......2.9.4...5...6...7...5.9.3.......7.......85..4.7.....6...3...9.8...2.....1 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   150
1 . . | . . . | . . 2  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   151
. 9 . | 4 . . | . 5 .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   152
. . 6 | . . . | 7 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   153
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   154
. 5 . | 9 . 3 | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   155
. . . | . 7 . | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   156
. . . | 8 5 . | . 4 .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   157
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   158
7 . . | . . . | 6 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   159
. 3 . | . . 9 | . 8 .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   160
. . 2 | . . . | . . 1  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   161
\end{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   162
*}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   163
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   164
theorem "\<not> sudoku
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   165
     1  x12 x13 x14 x15 x16 x17 x18  2 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   166
    x21  9  x23  4  x25 x26 x27  5  x29
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   167
    x31 x32  6  x34 x35 x36  7  x38 x39
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   168
    x41  5  x43  9  x45  3  x47 x48 x49
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   169
    x51 x52 x53 x54  7  x56 x57 x58 x59
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   170
    x61 x62 x63  8   5  x66 x67  4  x69
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   171
     7  x72 x73 x74 x75 x76  6  x78 x79
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   172
    x81  3  x83 x84 x85  9  x87  8  x89
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   173
    x91 x92  2  x94 x95 x96 x97 x98  1 "
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   174
  nitpick [expect=genuine]
28949
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   175
oops
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   176
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   177
text {*
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   178
\begin{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   179
Rating Program: gsf's sudoku q1 (Processing time) 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   180
Rating: 4m19s@2 GHz 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   181
Poster: tarek 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   182
Label: tarek071223170000-052 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   183
..1..4.......6.3.5...9.....8.....7.3.......285...7.6..3...8...6..92......4...1... 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   184
. . 1 | . . 4 | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   185
. . . | . 6 . | 3 . 5  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   186
. . . | 9 . . | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   187
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   188
8 . . | . . . | 7 . 3  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   189
. . . | . . . | . 2 8  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   190
5 . . | . 7 . | 6 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   191
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   192
3 . . | . 8 . | . . 6  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   193
. . 9 | 2 . . | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   194
. 4 . | . . 1 | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   195
\end{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   196
*}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   197
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   198
theorem "\<not> sudoku
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   199
    x11 x12  1  x14 x15  4  x17 x18 x19
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   200
    x21 x22 x23 x24  6  x26  3  x28  5 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   201
    x31 x32 x33  9  x35 x36 x37 x38 x39
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   202
     8  x42 x43 x44 x45 x46  7  x48  3 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   203
    x51 x52 x53 x54 x55 x56 x57  2   8 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   204
     5  x62 x63 x64  7  x66  6  x68 x69
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   205
     3  x72 x73 x74  8  x76 x77 x78  6 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   206
    x81 x82  9   2  x85 x86 x87 x88 x89
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   207
    x91  4  x93 x94 x95  1  x97 x98 x99"
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   208
  nitpick [expect=genuine]
28949
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   209
oops
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   210
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   211
text {*
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   212
\begin{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   213
Rating Program: Nicolas Juillerat's Sudoku explainer 1.2.1 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   214
Rating: 11.9 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   215
Poster: tarek 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   216
Label: golden nugget 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   217
.......39.....1..5..3.5.8....8.9...6.7...2...1..4.......9.8..5..2....6..4..7..... 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   218
. . . | . . . | . 3 9  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   219
. . . | . . 1 | . . 5  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   220
. . 3 | . 5 . | 8 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   221
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   222
. . 8 | . 9 . | . . 6  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   223
. 7 . | . . 2 | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   224
1 . . | 4 . . | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   225
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   226
. . 9 | . 8 . | . 5 .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   227
. 2 . | . . . | 6 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   228
4 . . | 7 . . | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   229
\end{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   230
*}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   231
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   232
theorem "\<not> sudoku
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   233
    x11 x12 x13 x14 x15 x16 x17  3   9 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   234
    x21 x22 x23 x24 x25  1  x27 x28  5 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   235
    x31 x32  3  x34  5  x36  8  x38 x39
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   236
    x41 x42  8  x44  9  x46 x47 x48  6 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   237
    x51  7  x53 x54 x55  2  x57 x58 x59
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   238
     1  x62 x63  4  x65 x66 x67 x68 x69
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   239
    x71 x72  9  x74  8  x76 x77  5  x79
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   240
    x81  2  x83 x84 x85 x86  6  x88 x89
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   241
     4  x92 x93  7  x95 x96 x97 x98 x99"
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   242
  nitpick [expect=genuine]
28949
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   243
oops
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   244
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   245
text {*
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   246
\begin{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   247
Rating Program: dukuso's suexrat9 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   248
Rating: 4483 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   249
Poster: coloin 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   250
Label: col-02-08-071 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   251
.2.4.37.........32........4.4.2...7.8...5.........1...5.....9...3.9....7..1..86.. 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   252
. 2 . | 4 . 3 | 7 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   253
. . . | . . . | . 3 2  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   254
. . . | . . . | . . 4  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   255
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   256
. 4 . | 2 . . | . 7 .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   257
8 . . | . 5 . | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   258
. . . | . . 1 | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   259
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   260
5 . . | . . . | 9 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   261
. 3 . | 9 . . | . . 7  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   262
. . 1 | . . 8 | 6 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   263
\end{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   264
*}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   265
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   266
theorem "\<not> sudoku
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   267
    x11  2  x13  4  x15  3   7  x18 x19
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   268
    x21 x22 x23 x24 x25 x26 x27  3   2 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   269
    x31 x32 x33 x34 x35 x36 x37 x38  4 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   270
    x41  4  x43  2  x45 x46 x47  7  x49
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   271
     8  x52 x53 x54  5  x56 x57 x58 x59
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   272
    x61 x62 x63 x64 x65  1  x67 x68 x69
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   273
     5  x72 x73 x74 x75 x76  9  x78 x79
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   274
    x81  3  x83  9  x85 x86 x87 x88  7 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   275
    x91 x92  1  x94 x95  8   6  x98 x99"
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   276
  nitpick [expect=genuine]
28949
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   277
oops
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   278
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   279
text {*
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   280
\begin{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   281
Rating Program: dukuso's suexratt (10000 2 option) 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   282
Rating: 2141 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   283
Poster: tarek 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   284
Label: golden nugget 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   285
.......39.....1..5..3.5.8....8.9...6.7...2...1..4.......9.8..5..2....6..4..7..... 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   286
. . . | . . . | . 3 9  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   287
. . . | . . 1 | . . 5  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   288
. . 3 | . 5 . | 8 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   289
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   290
. . 8 | . 9 . | . . 6  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   291
. 7 . | . . 2 | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   292
1 . . | 4 . . | . . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   293
------+-------+------ 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   294
. . 9 | . 8 . | . 5 .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   295
. 2 . | . . . | 6 . .  
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   296
4 . . | 7 . . | . . .
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   297
\end{verbatim}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   298
*}
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   299
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   300
theorem "\<not> sudoku
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   301
    x11 x12 x13 x14 x15 x16 x17  3   9 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   302
    x21 x22 x23 x24 x25  1  x27 x28  5 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   303
    x31 x32  3  x34  5  x36  8  x38 x39
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   304
    x41 x42  8  x44  9  x46 x47 x48  6 
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   305
    x51  7  x53 x54 x55  2  x57 x58 x59
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   306
     1  x62 x63  4  x65 x66 x67 x68 x69
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   307
    x71 x72  9  x74  8  x76 x77  5  x79
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   308
    x81  2  x83 x84 x85 x86  6  x88 x89
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   309
     4  x92 x93  7  x95 x96 x97 x98 x99"
56940
35ce6dab3f5e Replaced refute with nitpick.
webertj
parents: 56815
diff changeset
   310
  nitpick [expect=genuine]
28949
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   311
oops
610fe33ca358 more examples
webertj
parents: 23219
diff changeset
   312
18408
07da804d1119 ex/Sudoku.thy
webertj
parents:
diff changeset
   313
end