Automated Pattern Deduction for Connect 4 in 1 Move (version 0.128 2024-12-20)
Step 0. Initial
game.connects4InMoves(player, 1) = true
Step 1. The system substitutes game.connects4InMoves(player, 1) with its predefined equivalence definition <=>
Ǝ 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
Step 2. The system substitutes connects4InMoves(player, 0) with its predefined equivalence definition <=>
Ǝ xMove: (Start Exists Move Concept)
xMove >= 0 and
xMove < xMax:
game.afterMove(xMove).matrix.pppp(player) = true and
game.afterMove(xMove).toMove = opponent(player)
Ǝend xMove (End Exists Move Concept) and
game.toMove = player and
game.matrix.pppp(opponent(player)) = false
Step 3. The system substitutes pppp(player) with its predefined equivalence definition <=>
Ǝ xMove: (Start Exists Move Concept)
xMove >= 0 and
xMove < xMax:
(Ǝ 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:
game.afterMove(xMove).matrix(x0, y0 + extent) = player
∀end extent (End All Extent: Connect in a Vertical Row Pattern) and
game.afterMove(xMove).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:
game.afterMove(xMove).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:
game.afterMove(xMove).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:
game.afterMove(xMove).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:
game.afterMove(xMove).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:
game.afterMove(xMove).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:
game.afterMove(xMove).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)) and
game.afterMove(xMove).toMove = opponent(player)
Ǝend xMove (End Exists Move Concept) and
game.toMove = player and
game.matrix.pppp(opponent(player)) = false
Step 4. The system adds the game.afterMove(xMove) predefined function its equivalence definition <=>
Ǝ xMove: (Start Exists Move Concept)
xMove >= 0 and
xMove < xMax:
(Ǝ 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:
game.afterMove(xMove).matrix(x0, y0 + extent) = player
∀end extent (End All Extent: Connect in a Vertical Row Pattern) and
game.afterMove(xMove).matrix.yEmpty(x0) = y0 + conn and
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)
Ǝ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:
game.afterMove(xMove).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:
game.afterMove(xMove).matrix.yEmpty(x0 + pmEx) = y0 + 1
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
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)
Ǝ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:
game.afterMove(xMove).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:
game.afterMove(xMove).matrix.yEmpty(x0 + pmEx) = y0 + pmEx + 1
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
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)
Ǝ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:
game.afterMove(xMove).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:
game.afterMove(xMove).matrix.yEmpty(x0 + pmEx) = y0 - pmEx + 1
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
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)
Ǝend x0, y0 (End Diagonal Down Pattern with top-left coordinates x0, y0)) and
game.afterMove(xMove).toMove = opponent(player)
Ǝend xMove (End Exists Move Concept) and
game.toMove = player and
game.matrix.pppp(opponent(player)) = false
Step 5. The system substitutes xMove with x0 in the first (vertical) pattern Ǝ x0, y0 and with x0 + pmEx in the horizontal, diagonal up and down patterns Ǝ x0, y0. <=>
Ǝ xMove: (Start Exists Move Concept)
xMove >= 0 and
xMove < xMax:
(Ǝ 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:
game.afterMove(x0).matrix(x0, y0 + extent) = player
∀end extent (End All Extent: Connect in a Vertical Row Pattern) and
game.afterMove(x0).matrix.yEmpty(x0) = y0 + conn and
game.matrix.yEmpty(x0) < yMax - 1 and
game.afterMove(x0).toMove = opponent(game.toMove) and
game.afterMove(x0).matrix(x0, game.matrix.yEmpty(x0)) = game.toMove and
game.afterMove(x0).matrix.yEmpty(x0) = game.matrix.yEmpty(x0) + 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 != x0 or
y != game.matrix.yEmpty(x0)):
game.afterMove(x0).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝ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:
game.afterMove(x0 + pmEx).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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + 1
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
game.matrix.yEmpty(x0 + pmEx) < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, game.matrix.yEmpty(x0 + pmEx)) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = game.matrix.yEmpty(x0 + pmEx) + 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 != x0 + pmEx or
y != game.matrix.yEmpty(x0 + pmEx)):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝ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:
game.afterMove(x0 + pmEx).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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + pmEx + 1
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
game.matrix.yEmpty(x0 + pmEx) < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, game.matrix.yEmpty(x0 + pmEx)) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = game.matrix.yEmpty(x0 + pmEx) + 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 != x0 + pmEx or
y != game.matrix.yEmpty(x0 + pmEx)):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝ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:
game.afterMove(x0 + pmEx).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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 - pmEx + 1
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
game.matrix.yEmpty(x0 + pmEx) < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, game.matrix.yEmpty(x0 + pmEx)) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = game.matrix.yEmpty(x0 + pmEx) + 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 != x0 + pmEx or
y != game.matrix.yEmpty(x0 + pmEx)):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝend x0, y0 (End Diagonal Down Pattern with top-left coordinates x0, y0)) and
game.afterMove(xMove).toMove = opponent(player)
Ǝend xMove (End Exists Move Concept) and
game.toMove = player and
game.matrix.pppp(opponent(player)) = false
Step 6. From the two game.afterMove(x0).matrix.yEmpty(x0) statements the system solves
game.matrix.yEmpty(x0) = y0 + conn - 1 for the vertical Ǝ x0, y0 pattern, from the two game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) statements the system solves game.matrix.yEmpty(x0 + pmEx) = y0 for the horizontal Ǝ x0, y0 pattern,
game.matrix.yEmpty(x0 + pmEx) = y0 + pmEx for the diagonal up pattern and
game.matrix.yEmpty(x0 + pmEx) = y0 - pmEx for the diagonal down pattern,
adds these new statements and substitutes the left with the right of the above equations in the concerned Ǝ x0, y0 patterns. <=>
Ǝ xMove: (Start Exists Move Concept)
xMove >= 0 and
xMove < xMax:
(Ǝ 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:
game.afterMove(x0).matrix(x0, y0 + extent) = player
∀end extent (End All Extent: Connect in a Vertical Row Pattern) and
game.afterMove(x0).matrix.yEmpty(x0) = y0 + conn and
y0 + conn - 1 < yMax - 1 and
game.afterMove(x0).toMove = opponent(game.toMove) and
game.afterMove(x0).matrix(x0, game.matrix.yEmpty(x0)) = game.toMove and
game.afterMove(x0).matrix.yEmpty(x0) = y0 + conn - 1 + 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 != x0 or
y != y0 + conn - 1):
game.afterMove(x0).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk) and
game.matrix.yEmpty(x0) = y0 + conn - 1
Ǝ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:
game.afterMove(x0 + pmEx).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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + 1 and
game.matrix.yEmpty(x0 + pmEx) = y0
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
y0 < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, y0) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + 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 != x0 + pmEx or
y != y0):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝ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:
game.afterMove(x0 + pmEx).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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + pmEx + 1 and
game.matrix.yEmpty(x0 + pmEx) = y0 + pmEx
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
y0 + pmEx < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, game.matrix.yEmpty(x0 + pmEx)) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + pmEx + 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 != x0 + pmEx or
y != y0 + pmEx):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝ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:
game.afterMove(x0 + pmEx).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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 - pmEx + 1 and
game.matrix.yEmpty(x0 + pmEx) = y0 - pmEx
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
y0 - pmEx < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, game.matrix.yEmpty(x0 + pmEx)) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 - pmEx + 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 != x0 + pmEx or
y != y0 - pmEx):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝend x0, y0 (End Diagonal Down Pattern with top-left coordinates x0, y0)) and
game.afterMove(xMove).toMove = opponent(player)
Ǝend xMove (End Exists Move Concept) and
game.toMove = player and
game.matrix.pppp(opponent(player)) = false
Step 7. The system applies in the vertical Ǝ x0, y0 pattern ∀ x, y onto ∀ extent to substitute game.afterMove(x0).matrix(x0, y0 + extent) in the rule of the ∀ extent with game.matrix(x0, y0 + extent) (this is the game board before the 1 winning move). As such the system also adds the (x != x0 or y != y0 + conn - 1) delimiter rule from ∀ x, y into the ∀ extent. The above substitution (equality rule) also implies the substitution of x with x0 and of y with y0 + extent in the latter added delimiter rule. The system does similar (with variation in the substitutions to be applied) for the horizontal, diagonal up and down Ǝ x0, y0 patterns. <=>
Ǝ xMove: (Start Exists Move Concept)
xMove >= 0 and
xMove < xMax:
(Ǝ 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 and
(x0 != x0 or
y0 + extent != y0 + conn - 1):
game.matrix(x0, y0 + extent) = player
∀end extent (End All Extent: Connect in a Vertical Row Pattern) and
game.afterMove(x0).matrix.yEmpty(x0) = y0 + conn and
y0 + conn - 1 < yMax - 1 and
game.afterMove(x0).toMove = opponent(game.toMove) and
game.afterMove(x0).matrix(x0, game.matrix.yEmpty(x0)) = game.toMove and
game.afterMove(x0).matrix.yEmpty(x0) = y0 + conn - 1 + 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 != x0 or
y != y0 + conn - 1):
game.afterMove(x0).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk) and
game.matrix.yEmpty(x0) = y0 + conn - 1
Ǝ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
(x0 + extent != x0 + pmEx or
y0 != y0):
game.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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + 1 and
game.matrix.yEmpty(x0 + pmEx) = y0
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
y0 < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, y0) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + 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 != x0 + pmEx or
y != y0):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝ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
(x0 + extent != x0 + pmEx or
y0 + extent != y0 + pmEx):
game.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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + pmEx + 1 and
game.matrix.yEmpty(x0 + pmEx) = y0 + pmEx
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
y0 + pmEx < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, game.matrix.yEmpty(x0 + pmEx)) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + pmEx + 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 != x0 + pmEx or
y != y0 + pmEx):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝ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
(x0 + extent != x0 + pmEx or
y0 - extent != y0 - pmEx):
game.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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 - pmEx + 1 and
game.matrix.yEmpty(x0 + pmEx) = y0 - pmEx
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
y0 - pmEx < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, game.matrix.yEmpty(x0 + pmEx)) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 - pmEx + 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 != x0 + pmEx or
y != y0 - pmEx):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝend x0, y0 (End Diagonal Down Pattern with top-left coordinates x0, y0)) and
game.afterMove(xMove).toMove = opponent(player)
Ǝend xMove (End Exists Move Concept) and
game.toMove = player and
game.matrix.pppp(opponent(player)) = false
Step 8. The system normalizes the delimiters of the ∀ extent sections. This is the system evaluates and merges these delimiters rules to a minimal set of equivalent delimiter rules. <=>
Ǝ xMove: (Start Exists Move Concept)
xMove >= 0 and
xMove < xMax:
(Ǝ 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:
game.matrix(x0, y0 + extent) = player
∀end extent (End All Extent: Connect in a Vertical Row Pattern) and
game.afterMove(x0).matrix.yEmpty(x0) = y0 + conn and
y0 + conn - 1 < yMax - 1 and
game.afterMove(x0).toMove = opponent(game.toMove) and
game.afterMove(x0).matrix(x0, game.matrix.yEmpty(x0)) = game.toMove and
game.afterMove(x0).matrix.yEmpty(x0) = y0 + conn - 1 + 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 != x0 or
y != y0 + conn - 1):
game.afterMove(x0).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk) and
game.matrix.yEmpty(x0) = y0 + conn - 1
Ǝ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 != pmEx:
game.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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + 1 and
game.matrix.yEmpty(x0 + pmEx) = y0
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
y0 < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, y0) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + 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 != x0 + pmEx or
y != y0):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝ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 != pmEx:
game.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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + pmEx + 1 and
game.matrix.yEmpty(x0 + pmEx) = y0 + pmEx
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
y0 + pmEx < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, game.matrix.yEmpty(x0 + pmEx)) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 + pmEx + 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 != x0 + pmEx or
y != y0 + pmEx):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝ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 != pmEx:
game.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:
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 - pmEx + 1 and
game.matrix.yEmpty(x0 + pmEx) = y0 - pmEx
Ǝend pmEx (End Exists Previous Move Extent with Empty Position Above) and
y0 - pmEx < yMax - 1 and
game.afterMove(x0 + pmEx).toMove = opponent(game.toMove) and
game.afterMove(x0 + pmEx).matrix(x0 + pmEx, game.matrix.yEmpty(x0 + pmEx)) = game.toMove and
game.afterMove(x0 + pmEx).matrix.yEmpty(x0 + pmEx) = y0 - pmEx + 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 != x0 + pmEx or
y != y0 - pmEx):
game.afterMove(x0 + pmEx).matrix(x, y) = game.matrix(x, y)
∀end x, y (End Matrix after move equals matrix before move except the new Disk)
Ǝend x0, y0 (End Diagonal Down Pattern with top-left coordinates x0, y0)) and
game.afterMove(xMove).toMove = opponent(player)
Ǝend xMove (End Exists Move Concept) and
game.toMove = player and
game.matrix.pppp(opponent(player)) = false
Step 9. The system matches the green rules and quantifiers in the above step with the equivalence definition of the matrix.reppp(player, 0, rex) pattern (see predefined patterns below) and deducts (proofs) as such the re0ppp pattern. In other words step 9 recognizes the re0ppp pattern in the result of the deduction upto step 8. The rules and quantifiers are matched for the vertical, horizontal and diagonal up and down Ǝ x0, y0 patterns. <=>
game.matrix.reppp(player, 0, rex) = true and
game.toMove = player and
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)
|