Automated Pattern Deduction for Connect 4 in 3 Moves (version 0.128 2024-12-20)
Step 0. Initial
game.connects4InMoves(player, 3) = true
Step 1. The system substitutes game.connects4InMoves(player, 3) with its predefined equivalence definition <=>
Ǝ xExistsMove: (Start Exists Move Concept)
xExistsMove >= 0 and
xExistsMove < xMax:
game.afterMove(xExistsMove).connects4InMoves(player, 2) = true
Ǝend xExistsMove (End Exists Move Concept) and
game.connects4InMoves(player, 1) = false
Step 2. The system substitutes connects4InMoves(player, 2) and connects4InMoves(player, 1) with their deduced equivalence definitions. <=>
Ǝ xExistsMove: (Start Exists Move Concept)
xExistsMove >= 0 and
xExistsMove < xMax:
((∀ xMove: (Start For All Move Concept)
xMove >= 0 and
xMove < xMax and
game.afterMove(xExistsMove).matrix.yEmpty(xMove) < yMax - 1:
game.afterMove(xExistsMove).matrix.reppp(player, 1, xMove) = true
∀end xMove (End For All Move Concept) and
game.afterMove(xExistsMove).matrix.reppp(player, 1, rex) = true) or
(x1 != x2 and
game.afterMove(xExistsMove).matrix.reppp(player, 0, x1) = true and
game.afterMove(xExistsMove).matrix.reppp(player, 0, x2) = true) or
(game.afterMove(xExistsMove).matrix.reppp(player, 1, xs) = true and
game.afterMove(xExistsMove).matrix.reppp(player, 0, xs) = true)) and
game.afterMove(xExistsMove).toMove = opponent(player) and
game.afterMove(xExistsMove).matrix.reppp(opponent(player), 0, rex) = false and
game.afterMove(xExistsMove).matrix.pppp(opponent(player)) = false
Ǝend xExistsMove (End Exists Move Concept) and
(game.matrix.reppp(player, 0, rex) = false or
game.toMove = opponent(player) or
game.matrix.pppp(opponent(player)) = true)
Step 3. The system substitutes the game.afterMove(xMove).* functions with their deduced equivalence definitions <=>
Ǝ xExistsMove: (Start Exists Move Concept)
xExistsMove >= 0 and
xExistsMove < xMax:
((∀ xMove: (Start For All Move Concept)
xMove >= 0 and
xMove < xMax and
game.afterMove(xExistsMove).matrix.yEmpty(xMove) < yMax - 1:
((xExistsMove = xMove and
game.matrix.reppp(player, 2, xExistsMove) = true) or
(xExistsMove != xMove and
game.matrix.reppp(player, 1, xMove) = true) or
(game.toMove = player and
game.matrix.rerepp(player, 0, xExistsMove, 1, xMove) = true))
∀end xMove (End For All Move Concept) and
game.afterMove(xExistsMove).matrix.reppp(player, 1, rex) = true) or
(x1 != x2 and
(((xExistsMove = x1 and
game.matrix.reppp(player, 1, xExistsMove) = true) or
(xExistsMove != x1 and
game.matrix.reppp(player, 0, x1) = true) or
(game.toMove = player and
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xa) = true) or
(game.toMove = player and
game.matrix.vrep(player, 1, xExistsMove) = true))) and
(((xExistsMove = x2 and
game.matrix.reppp(player, 1, xExistsMove) = true) or
(xExistsMove != x2 and
game.matrix.reppp(player, 0, x2) = true) or
(game.toMove = player and
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xb) = true) or
(game.toMove = player and
game.matrix.vrep(player, 1, xExistsMove) = true)))) or
((((xExistsMove = xs and
game.matrix.reppp(player, 2, xExistsMove) = true) or
(xExistsMove != xs and
game.matrix.reppp(player, 1, xs) = true) or
(game.toMove = player and
game.matrix.rerepp(player, 0, xExistsMove, 1, xs) = true))) and
(((xExistsMove = xs and
game.matrix.reppp(player, 1, xExistsMove) = true) or
(xExistsMove != xs and
game.matrix.reppp(player, 0, xs) = true) or
(game.toMove = player and
game.matrix.rerepp(player, 0, xExistsMove, 0, re2x) = true) or
(game.toMove = player and
game.matrix.vrep(player, 1, xExistsMove) = true))))) and
game.toMove = player and
((xExistsMove != rexOpp or
game.matrix.reppp(opponent(player), 1, xExistsMove) = false) and
(xExistsMove = rexOpp or
game.matrix.reppp(opponent(player), 0, rexOpp) = false) and
(game.toMove = player or
game.matrix.rerepp(opponent(player), 0, xExistsMove, 0, re2x) = false) and
(game.toMove = player or
game.matrix.vrep(opponent(player), 1, xExistsMove) = false)) and
((game.matrix.reppp(opponent(player), 0, xExistsMove) = false or
game.toMove = player) and
game.matrix.pppp(opponent(player)) = false)
Ǝend xExistsMove (End Exists Move Concept) and
(game.matrix.reppp(player, 0, rex) = false or
game.toMove = opponent(player) or
game.matrix.pppp(opponent(player)) = true)
Step 4. The system eliminates all rules based on game.toMove = player and game.matrix.pppp(opponent(player)) = false being true. It also eliminates xExistsMove != rexOpp because rexOpp is not bound to anything else in this case. See green and red above. <=>
Ǝ xExistsMove: (Start Exists Move Concept)
xExistsMove >= 0 and
xExistsMove < xMax:
((∀ xMove: (Start For All Move Concept)
xMove >= 0 and
xMove < xMax and
game.afterMove(xExistsMove).matrix.yEmpty(xMove) < yMax - 1:
((xExistsMove = xMove and
game.matrix.reppp(player, 2, xExistsMove) = true) or
(xExistsMove != xMove and
game.matrix.reppp(player, 1, xMove) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 1, xMove) = true)
∀end xMove (End For All Move Concept) and
game.afterMove(xExistsMove).matrix.reppp(player, 1, rex) = true) or
(x1 != x2 and
(((xExistsMove = x1 and
game.matrix.reppp(player, 1, xExistsMove) = true) or
(xExistsMove != x1 and
game.matrix.reppp(player, 0, x1) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xa) = true or
game.matrix.vrep(player, 1, xExistsMove) = true)) and
(((xExistsMove = x2 and
game.matrix.reppp(player, 1, xExistsMove) = true) or
(xExistsMove != x2 and
game.matrix.reppp(player, 0, x2) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xb) = true or
game.matrix.vrep(player, 1, xExistsMove) = true))) or
((((xExistsMove = xs and
game.matrix.reppp(player, 2, xExistsMove) = true) or
(xExistsMove != xs and
game.matrix.reppp(player, 1, xs) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 1, xs) = true)) and
(((xExistsMove = xs and
game.matrix.reppp(player, 1, xExistsMove) = true) or
(xExistsMove != xs and
game.matrix.reppp(player, 0, xs) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 0, re2x) = true or
game.matrix.vrep(player, 1, xExistsMove) = true)))) and
game.toMove = player and
game.matrix.reppp(opponent(player), 1, xExistsMove) = false and
(xExistsMove = rexOpp or
game.matrix.reppp(opponent(player), 0, rexOpp) = false) and
game.matrix.pppp(opponent(player)) = false
Ǝend xExistsMove (End Exists Move Concept) and
game.matrix.reppp(player, 0, rex) = false
Step 5. The system eliminates all rules based on game.matrix.reppp(player, 0, rex) = false being true. See green and red above. <=>
Ǝ xExistsMove: (Start Exists Move Concept)
xExistsMove >= 0 and
xExistsMove < xMax:
((∀ xMove: (Start For All Move Concept)
xMove >= 0 and
xMove < xMax and
game.afterMove(xExistsMove).matrix.yEmpty(xMove) < yMax - 1:
((xExistsMove = xMove and
game.matrix.reppp(player, 2, xExistsMove) = true) or
(xExistsMove != xMove and
game.matrix.reppp(player, 1, xMove) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 1, xMove) = true)
∀end xMove (End For All Move Concept) and
game.afterMove(xExistsMove).matrix.reppp(player, 1, rex) = true) or
(x1 != x2 and
(((xExistsMove = x1 and
game.matrix.reppp(player, 1, xExistsMove) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xa) = true or
game.matrix.vrep(player, 1, xExistsMove) = true)) and
(((xExistsMove = x2 and
game.matrix.reppp(player, 1, xExistsMove) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xb) = true or
game.matrix.vrep(player, 1, xExistsMove) = true))) or
((((xExistsMove = xs and
game.matrix.reppp(player, 2, xExistsMove) = true) or
(xExistsMove != xs and
game.matrix.reppp(player, 1, xs) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 1, xs) = true)) and
(((xExistsMove = xs and
game.matrix.reppp(player, 1, xExistsMove) = true) or
game.matrix.rerepp(player, 0, xExistsMove, 0, re2x) = true or
game.matrix.vrep(player, 1, xExistsMove) = true)))) and
game.toMove = player and
game.matrix.reppp(opponent(player), 1, xExistsMove) = false and
(xExistsMove = rexOpp or
game.matrix.reppp(opponent(player), 0, rexOpp) = false) and
game.matrix.pppp(opponent(player)) = false
Ǝend xExistsMove (End Exists Move Concept) and
game.matrix.reppp(player, 0, rex) = false
Step 6. The system exports game.matrix.reppp(player, 2, xExistsMove) = true out of the all move concept and ors it with game.matrix.yEmpty(xExistsMove) = yMax - 2 to account for the case the player moves on a column with just one empty position making it full (this is closed) after this move. The latter rule is anded with game.afterMove(xExistsMove).matrix.reppp(player, 1, rex) = true from which as such .afterMove(xExistsMove) is removed. As such the system adds xExistsMove != xMove as a delimiter rule to the all move concept. As such the system can remove afterMove(xExistsMove) from the existing delimiter rule game.afterMove(xExistsMove).matrix.yEmpty(xMove) < yMax - 1 to obtain game.matrix.yEmpty(xMove) < yMax - 1. As such the system keeps game.matrix.reppp(player, 1, xMove) = true as a non delimiter rule of the for all move concept. The system ors the latter rule with game.matrix.rerepp(player, 0, xExistsMove, 1, xMove) = true to account for the winning move that closes a column and at the same time creates for another column a re1ppp pattern from the re0re1pp pattern. For the x1 != x2 part, split off from the for all move concept in the 4 in 2 moves deduction, the system deduces the following three pattern combinations as shown below and described here: 1. Combination of a re1ppp and a re0re0pp pattern sharing a rotatable empty position (re) on which the player moves (xExistsMove). 2. Combination of two re0re0pp patterns sharing a rotatable empty position (re) on which the player moves. 3. Combination of a vertical re0re1pp and a re0re0pp pattern sharing a rotatable empty position with depth 0 (re0) on which the player moves. For the xs (xShared) part, split off from the for all move concept in the 4 in 2 moves deduction, the system deduces the following three pattern combinations as shown below and described here: 1. Combination of a re2ppp and a re1ppp pattern sharing the rotatable empty position (re) on which the player moves. 2. Combination of a re1ppp and a re0re0pp pattern sharing a rotatable empty position (re). The player moves on the unshared re of the re0re0pp pattern. 3. Combination of a re0re1pp and a re0re0pp pattern sharing a rotatable empty position (re0) on which the player moves. This move creates re1ppp and re0ppp patterns on top of eachother (same re) enabling the player to win. <=>
Ǝ xExistsMove: (Start Exists Move Concept)
xExistsMove >= 0 and
xExistsMove < xMax:
((∀ xMove: (Start For All Move Concept)
xMove >= 0 and
xMove < xMax and
game.matrix.yEmpty(xMove) < yMax - 1 and
xExistsMove != xMove:
(game.matrix.reppp(player, 1, xMove) = true or
game.matrix.rerepp(player, 0, xExistsMove, 1, xMove) = true)
∀end xMove (End For All Move Concept) and
((game.matrix.reppp(player, 1, rex) = true and
game.matrix.yEmpty(xExistsMove) = yMax - 2) or
game.matrix.reppp(player, 2, xExistsMove) = true or
game.matrix.rerepp(player, 0, xExistsMove, 1, re2x) = true)) or
((game.matrix.reppp(player, 1, xExistsMove) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xb) = true) or
(game.matrix.rerepp(player, 0, xExistsMove, 0, re2xa) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xb) = true) or
(game.matrix.rerepp(player, 0, xExistsMove, 0, re2xa) = true and
game.matrix.vrep(player, 1, xExistsMove) = true)) or
((game.matrix.reppp(player, 2, xExistsMove) = true and
game.matrix.reppp(player, 1, xExistsMove) = true) or
(game.matrix.reppp(player, 1, xs) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, xs) = true) or
(game.matrix.rerepp(player, 0, xExistsMove, 1, xs) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, xs) = true))) and
game.toMove = player and
game.matrix.reppp(opponent(player), 1, xExistsMove) = false and
(xExistsMove = rexOpp or
game.matrix.reppp(opponent(player), 0, rexOpp) = false) and
game.matrix.pppp(opponent(player)) = false
Ǝend xExistsMove (End Exists Move Concept) and
game.matrix.reppp(player, 0, rex) = false
Step 7. The system also eliminates unneeded parenthesis. The system moves game.matrix.pppp(opponent(player)) = false out of the exists move concept because it does not depend on xExistsMove. This is the final step of the 4 in 3 moves automated deduction. <=>
Ǝ xExistsMove: (Start Exists Move Concept)
xExistsMove >= 0 and
xExistsMove < xMax:
((∀ xMove: (Start For All Move Concept)
xMove >= 0 and
xMove < xMax and
game.matrix.yEmpty(xMove) < yMax - 1 and
xExistsMove != xMove:
(game.matrix.reppp(player, 1, xMove) = true or
game.matrix.rerepp(player, 0, xExistsMove, 1, xMove) = true)
∀end xMove (End For All Move Concept) and
((game.matrix.reppp(player, 1, rex) = true and
game.matrix.yEmpty(xExistsMove) = yMax - 2) or
game.matrix.reppp(player, 2, xExistsMove) = true or
game.matrix.rerepp(player, 0, xExistsMove, 1, re2x) = true)) or
(game.matrix.reppp(player, 1, xExistsMove) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xb) = true) or
(game.matrix.rerepp(player, 0, xExistsMove, 0, re2xa) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xb) = true) or
(game.matrix.rerepp(player, 0, xExistsMove, 0, re2xa) = true and
game.matrix.vrep(player, 1, xExistsMove) = true) and
(game.matrix.reppp(player, 2, xExistsMove) = true and
game.matrix.reppp(player, 1, xExistsMove) = true) or
(game.matrix.reppp(player, 1, xs) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, xs) = true) or
(game.matrix.rerepp(player, 0, xExistsMove, 1, xs) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, xs) = true)) and
game.toMove = player and
game.matrix.reppp(opponent(player), 1, xExistsMove) = false and
(xExistsMove = rexOpp or
game.matrix.reppp(opponent(player), 0, rexOpp) = false)
Ǝend xExistsMove (End Exists Move Concept) and
game.matrix.reppp(player, 0, rex) = false or
game.matrix.pppp(opponent(player)) = false
Connect Four Classes, Rules, Quantifiers and Predefined and Deduced Pattern Functions
xMax = 7
yMax = 6
conn = 4
opponent(1) = 2
opponent(2) = 1
game.connects4InMoves(player, 1) <=> (Predefined Pattern Function)
Ǝ xMove: (Start Exists Move Concept)
xMove >= 0 and
xMove < xMax:
game.afterMove(xMove).connects4InMoves(player, 0) = true
Ǝend xMove (End Exists Move Concept) and
game.toMove = player and
game.matrix.pppp(opponent(player)) = false
game.connects4InMoves(player, 2) <=> (Predefined Pattern Function)
∀ xMove: (Start For All Move Concept)
xMove >= 0 and
xMove < xMax and
game.matrix.yEmpty(xMove) < yMax - 1:
game.afterMove(xMove).connects4InMoves(player, 1) = true
∀end xMove (End For All Move Concept)
game.connects4InMoves(player, 3) <=> (Predefined Pattern Function)
Ǝ xExistsMove: (Start Exists Move Concept)
xExistsMove >= 0 and
xExistsMove < xMax:
game.afterMove(xExistsMove).connects4InMoves(player, 2) = true
Ǝend xExistsMove (End Exists Move Concept) and
game.connects4InMoves(player, 1) = false
game.connects4InMoves(player, 4) <=> (Predefined Pattern Function)
∀ xAll4Move: (Start For All Move Concept)
xAll4Move >= 0 and
xAll4Move < xMax and
game.matrix.yEmpty(xAll4Move) < yMax - 1:
game.afterMove(xAll4Move).connects4InMoves(player, 3) = true
∀end xAll4Move (End For All Move Concept)
matrix.pppp(player) <=> (Predefined Pattern Function)
Ǝ x0, y0: (Start Vertical Pattern with bottom coordinates x0, y0)
x0 >= 0 and
x0 < xMax and
y0 >= 0 and
y0 < yMax - conn:
∀ extent: (Start All Extent: Connect in a Vertical Row Pattern)
extent >= 0 and
extent < conn:
matrix(x0, y0 + extent) = player
∀end extent (End All Extent: Connect in a Vertical Row Pattern) and
matrix.yEmpty(x0) = y0 + conn
Ǝend x0, y0 (End Vertical Pattern with bottom coordinates x0, y0) or
Ǝ x0, y0: (Start Horizontal Pattern with left coordinates x0, y0)
x0 >= 0 and
x0 < xMax - conn and
y0 >= 0 and
y0 < yMax:
∀ extent: (Start All Extent: Connect in a Horizontal Row Pattern)
extent >= 0 and
extent < conn:
matrix(x0 + extent, y0) = player
∀end extent (End All Extent: Connect in a Horizontal Row Pattern) and
Ǝ pmEx: (Start Exists Previous Move Extent with Empty Position Above)
pmEx >= 0 and
pmEx < conn:
matrix.yEmpty(x0 + pmEx) = y0 + 1
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above)
Ǝend x0, y0 (End Horizontal Pattern with left coordinates x0, y0) or
Ǝ x0, y0: (Start Diagonal Up Pattern with bottom-left coordinates x0, y0)
x0 >= 0 and
x0 < xMax - conn and
y0 >= 0 and
y0 < yMax - conn:
∀ extent: (Start All Extent: Connect in a Diagonal Up Row Pattern)
extent >= 0 and
extent < conn:
matrix(x0 + extent, y0 + extent) = player
∀end extent (End All Extent: Connect in a Diagonal Up Row Pattern) and
Ǝ pmEx: (Start Exists Previous Move Extent with Empty Position Above)
pmEx >= 0 and
pmEx < conn:
matrix.yEmpty(x0 + pmEx) = y0 + pmEx + 1
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above)
Ǝend x0, y0 (End Diagonal Up Pattern with bottom-left coordinates x0, y0) or
Ǝ x0, y0: (Start Diagonal Down Pattern with top-left coordinates x0, y0)
x0 >= 0 and
x0 < xMax - conn and
y0 >= conn and
y0 < yMax:
∀ extent: (Start All Extent: Connect in a Diagonal Down Row Pattern)
extent >= 0 and
extent < conn:
matrix(x0 + extent, y0 - extent) = player
∀end extent (End All Extent: Connect in a Diagonal Down Row Pattern) and
Ǝ pmEx: (Start Exists Previous Move Extent with Empty Position Above)
pmEx >= 0 and
pmEx < conn:
matrix.yEmpty(x0 + pmEx) = y0 - pmEx + 1
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above)
Ǝend x0, y0 (End Diagonal Down Pattern with top-left coordinates x0, y0)
game.connects4InMoves(player, 0) <=> (Predefined Pattern Function)
game.matrix.pppp(player) = true and
game.toMove = opponent(player)
game.afterMove(xMove) <=> (Predefined Pattern Function)
game.matrix.yEmpty(xMove) < yMax - 1 and
game.afterMove(xMove).toMove = opponent(game.toMove) and
game.afterMove(xMove).matrix(xMove, game.matrix.yEmpty(xMove)) = game.toMove and
game.afterMove(xMove).matrix.yEmpty(xMove) = game.matrix.yEmpty(xMove) + 1 and
∀ x, y: (Start Matrix after move equals matrix before move except the new Disk)
x >= 0 and
x < xMax and
y >= 0 and
y < yMax and
(x != xMove or
y != game.matrix.yEmpty(xMove)):
game.afterMove(xMove).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
matrix.reppp(player, red, rex) <=> (Predefined Pattern Function)
Ǝ x0, y0: (Start Vertical Pattern with bottom coordinates x0, y0)
x0 >= 0 and
x0 < xMax and
y0 >= 0 and
y0 < yMax - conn:
∀ extent: (Start All Extent: Connect in a Vertical Row Pattern)
extent >= 0 and
extent < conn - 1:
matrix(x0, y0 + extent) = player
∀end extent (End All Extent: Connect in a Vertical Row Pattern) and
matrix.yEmpty(rex) = y0 + conn - 1 - red and
rex = x0
Ǝend x0, y0 (End Vertical Pattern with bottom coordinates x0, y0) or
Ǝ x0, y0: (Start Horizontal Pattern with left coordinates x0, y0)
x0 >= 0 and
x0 < xMax - conn and
y0 >= 0 and
y0 < yMax:
∀ extent: (Start All Extent: Connect in a Horizontal Row Pattern)
extent >= 0 and
extent < conn and
extent != rexEx:
matrix(x0 + extent, y0) = player
∀end extent (End All Extent: Connect in a Horizontal Row Pattern) and
Ǝ rexEx: (Start re0 Extent: Extent of the Rotatable Empty position in the re0ppp Pattern)
rexEx >= 0 and
rexEx < conn:
matrix.yEmpty(rex) = y0 - red and
rex = x0 + rexEx
Ǝend rexEx (End re0 Extent: Extent of the Rotatable Empty position in the re0ppp Pattern)
Ǝend x0, y0 (End Horizontal Pattern with left coordinates x0, y0) or
Ǝ x0, y0: (Start Diagonal Up Pattern with bottom-left coordinates x0, y0)
x0 >= 0 and
x0 < xMax - conn and
y0 >= 0 and
y0 < yMax - conn:
∀ extent: (Start All Extent: Connect in a Diagonal Up Row Pattern)
extent >= 0 and
extent < conn and
extent != rexEx:
matrix(x0 + extent, y0 + extent) = player
∀end extent (End All Extent: Connect in a Diagonal Up Row Pattern) and
Ǝ rexEx: (Start re0 Extent: Extent of the Rotatable Empty position in the re0ppp Pattern)
rexEx >= 0 and
rexEx < conn:
matrix.yEmpty(rex) = y0 + rexEx - red and
rex = x0 + rexEx
Ǝend rexEx (End re0 Extent: Extent of the Rotatable Empty position in the re0ppp Pattern)
Ǝend x0, y0 (End Diagonal Up Pattern with bottom-left coordinates x0, y0) or
Ǝ x0, y0: (Start Diagonal Down Pattern with top-left coordinates x0, y0)
x0 >= 0 and
x0 < xMax - conn and
y0 >= conn and
y0 < yMax:
∀ extent: (Start All Extent: Connect in a Diagonal Down Row Pattern)
extent >= 0 and
extent < conn and
extent != rexEx:
matrix(x0 + extent, y0 - extent) = player
∀end extent (End All Extent: Connect in a Diagonal Down Row Pattern) and
Ǝ rexEx: (Start re0 Extent: Extent of the Rotatable Empty position in the re0ppp Pattern)
rexEx >= 0 and
rexEx < conn:
matrix.yEmpty(rex) = y0 - rexEx - red and
rex = x0 + rexEx
Ǝend rexEx (End re0 Extent: Extent of the Rotatable Empty position in the re0ppp Pattern)
Ǝend x0, y0 (End Diagonal Down Pattern with top-left coordinates x0, y0)
game.connects4InMoves(player, 1) = true <=> (Deduced Pattern)
game.matrix.reppp(player, 0, rex) = true and
game.toMove = player and
game.matrix.pppp(opponent(player)) = false
game.afterMove(xMove).matrix.pppp(player) = true <=> (Deduced Pattern)
((game.matrix.reppp(player, 0, xMove) = true and
game.toMove = player) or
game.matrix.pppp(player) = true)
game.afterMove(xMove).matrix.reppp(player, 0, rex) = true <=> (Deduced Pattern)
((xMove = rex and
game.matrix.reppp(player, 1, xMove) = true) or
(xMove != rex and
game.matrix.reppp(player, 0, rex) = true) or
(game.toMove = player and
game.matrix.rerepp(player, 0, xMove, 0, re2x) = true) or
(game.toMove = player and
game.matrix.vrep(player, 1, xMove) = true))
game.afterMove(xMove).matrix.reppp(player, 1, rex) = true <=> (Deduced Pattern)
((xMove = rex and
game.matrix.reppp(player, 2, xMove) = true) or
(xMove != rex and
game.matrix.reppp(player, 1, rex) = true) or
(game.toMove = player and
game.matrix.rerepp(player, 0, xMove, 1, rex) = true))
game.afterMove(xMove).matrix.reppp(player, 2, rex) = true <=> (Deduced Pattern)
((xMove = rex and
game.matrix.reppp(player, 3, xMove) = true) or
(xMove != rex and
game.matrix.reppp(player, 2, rex) = true) or
(game.toMove = player and
game.matrix.rerepp(player, 0, xMove, 2, rex) = true))
game.afterMove(xMove).matrix.rerepp(player, 0, re1x, 1, re2x) = true <=> (Deduced Pattern)
((xMove = re1x and
game.matrix.rerepp(player, 1, xMove, 1, re2x) = true) or
(xMove = re2x and
game.matrix.rerepp(player, 0, re1x, 2, xMove) = true) or
(xMove != re1x and
xMove != re2x and
game.matrix.rerepp(player, 0, re1x, 1, re2x) = true) or
(game.toMove = player and
game.matrix.rererep(player, 0, xMove, 0, re2x, 1, re3x) = true) or
(game.toMove = player and
game.matrix.rererep(player, 0, re1x, 0, xMove, 1, re3x) = true) or
(game.toMove = player and
game.matrix.vrep(player, 2, xMove) = true))
game.afterMove(xMove).toMove = player <=> (Deduced Pattern)
game.toMove = opponent(player)
game.afterMove(xMove).toMove = opponent(player) <=> (Deduced Pattern)
game.toMove = player
game.connects4InMoves(player, 2) <=> (Deduced Pattern)
((∀ xMove: (Start For All Move Concept)
xMove >= 0 and
xMove < xMax and
game.matrix.yEmpty(xMove) < yMax - 1:
game.matrix.reppp(player, 1, xMove) = true
∀end xMove (End For All Move Concept) and
game.matrix.reppp(player, 1, rex) = true) or
(x1 != x2 and
game.matrix.reppp(player, 0, x1) = true and
game.matrix.reppp(player, 0, x2) = true) or
(game.matrix.reppp(player, 1, xs) = true and
game.matrix.reppp(player, 0, xs) = true)) and
game.toMove = opponent(player) and
game.matrix.reppp(opponent(player), 0, rex) = false and
game.matrix.pppp(opponent(player)) = false
game.connects4InMoves(player, 3) <=> (Deduced Pattern)
Ǝ xExistsMove: (Start Exists Move Concept)
xExistsMove >= 0 and
xExistsMove < xMax:
((∀ xMove: (Start For All Move Concept)
xMove >= 0 and
xMove < xMax and
game.matrix.yEmpty(xMove) < yMax - 1 and
xExistsMove != xMove:
(game.matrix.reppp(player, 1, xMove) = true or
game.matrix.rerepp(player, 0, xExistsMove, 1, xMove) = true)
∀end xMove (End For All Move Concept) and
((game.matrix.reppp(player, 1, rex) = true and
game.matrix.yEmpty(xExistsMove) = yMax - 2) or
game.matrix.reppp(player, 2, xExistsMove) = true or
game.matrix.rerepp(player, 0, xExistsMove, 1, re2x) = true)) or
(game.matrix.reppp(player, 1, xExistsMove) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xb) = true) or
(game.matrix.rerepp(player, 0, xExistsMove, 0, re2xa) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, re2xb) = true) or
(game.matrix.rerepp(player, 0, xExistsMove, 0, re2xa) = true and
game.matrix.vrep(player, 1, xExistsMove) = true) and
(game.matrix.reppp(player, 2, xExistsMove) = true and
game.matrix.reppp(player, 1, xExistsMove) = true) or
(game.matrix.reppp(player, 1, xs) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, xs) = true) or
(game.matrix.rerepp(player, 0, xExistsMove, 1, xs) = true and
game.matrix.rerepp(player, 0, xExistsMove, 0, xs) = true)) and
game.toMove = player and
game.matrix.reppp(opponent(player), 1, xExistsMove) = false and
(xExistsMove = rexOpp or
game.matrix.reppp(opponent(player), 0, rexOpp) = false)
Ǝend xExistsMove (End Exists Move Concept) and
game.matrix.reppp(player, 0, rex) = false or
game.matrix.pppp(opponent(player)) = false
|