is there a program to detect patterns from positions?

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Uri Blass
Posts: 11125
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

is there a program to detect patterns from positions?

Post by Uri Blass »

Strong humans can memorize chess position quickly because they memorize patterns

For example
King g1 Rook f1 pawns h2 g2 f2 may be one pattern.

I would like to see some program that is not only about chess and may be also about other thinking games that get some list of positions and detect patterns that can help to memorize the positions.

The idea is the following you have an epd file of 1,000,000 chess positions and
you detect 1000 patterns that are more than a single piece in a single square when the target is to be able to construct every position in the million positions with a minimal average number of patterns.

I think that it may be useful for humans to be able to memorize chess positions.

There are a lot of chess players who clearly have problems also to memorize practical chess positions and I suspect that it is not always because they have a weaker memory but because their mind does not know what to memorize in their long term memory and some program that tell them the patterns to memorize may help them.
User avatar
phhnguyen
Posts: 1526
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: is there a program to detect patterns from positions?

Post by phhnguyen »

Is the below what you need?

Image

You can try right now, using Banksia GUI from version 0.54. It could work well with any PGN or .ocgdb.db3 file.

From the next version, it could run well with EPD file too.

Besides the BSG, you may use CQL on Scid vs. PC (however, CQL is a bit harder to learn and much slower than BSG).
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
Uri Blass
Posts: 11125
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: is there a program to detect patterns from positions?

Post by Uri Blass »

Not exactky what I asked.

The target is to have translate every position to some words when every word is practically one of 1000 chess patterns.


Suppose you have
pattern 127:white pieces king g1 Rook f1 pawns h2 g2 f2 and black pieces king g8 Rook f8 pawn h7 g7 f7
pattern 134:black bishop b7 black pawns a7 b6 c7 black knight d7 black queen e7
pattern 258:white rook a1 white pawn a2 black rook a8
pattern 432:White Queen e2 white Bishop c4 White knight f3
pattern 658:White pawns c3 d4 e4 black pawn e5

If you have in your long term memory all these patterns you detect them as words and basically you need to memorize only 5 words to memorize the position and memorizing 5 words is easy.

The target is to basically to express positions with minimal number of words when I assume that you have only 1000 words in your memory(you can use different number than 1000 but the idea is that memory is limited)

I do not know exactly how the mind of strong players work in order to help them to memorize the position that you posted in few seconds but I guess it is something similiar maybe with different patterns because my mind is not strong enough to know what patterns I need to memorize to memorize typical chess positions very fast.

I know basically that the structure of castling is really common and I know also that the structure of bishop b7 pawns a7 b6 c7 is common

Note that I think that the memory does not work exactly in the way I described because the pattern of king g1 rook f1 pawns h2 g2 f2 may help also to memorize a position with white King g2 rook f2 pawns h3 g3 f3 and I basically want to understand how strong player memorize positions that are not random positions fast by understanding what are the structures that they already have in their long term memory and also to be able to memorize positions better by learning to memorize the relevant structures and put them in my long term memory.
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: is there a program to detect patterns from positions?

Post by dangi12012 »

Uri Blass wrote: Wed Jul 27, 2022 2:06 pm The target is to basically to express positions with minimal number of words when I assume that you have only 1000 words in your memory(you can use different number than 1000 but the idea is that memory is limited)
What you are asking for exists already?
queen's gambit accepted
queen's indian defense
Caro-Kann

These are the opening names - and if a pattern occurs very often it gets a name.

Names for other positions:
"Castling is possible now"
"Smothered mate"
etc..

I dont know what you are asking? This basically exists.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
User avatar
towforce
Posts: 12708
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK
Full name: Graham Laight

Re: is there a program to detect patterns from positions?

Post by towforce »

There are almost certainly better patterns to be found than even the best human players know. Finding the complex mathematical relationships between pieces (and other aspects of the game) could yield quick and accurate evaluation functions.

NNs have made a good start, but we can do better!
Human chess is partly about tactics and strategy, but mostly about memory
Uri Blass
Posts: 11125
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: is there a program to detect patterns from positions?

Post by Uri Blass »

dangi12012 wrote: Wed Jul 27, 2022 10:33 pm
Uri Blass wrote: Wed Jul 27, 2022 2:06 pm The target is to basically to express positions with minimal number of words when I assume that you have only 1000 words in your memory(you can use different number than 1000 but the idea is that memory is limited)
What you are asking for exists already?
queen's gambit accepted
queen's indian defense
Caro-Kann

These are the opening names - and if a pattern occurs very often it gets a name.

Names for other positions:
"Castling is possible now"
"Smothered mate"
etc..

I dont know what you are asking? This basically exists.
I ask for a tool to help people to memorize chess positions.

The target is to express every normal chess position that strong chess players have no problem to memorize by a small number of words.

Only name of openings and name of few patterns does not help to express every normal chess position by a small number of words.

[fen]r4rk1/pbpnqppp/1p6/4p3/2BPP3/2P2N2/P3QPPP/R4RK1 w - - 0 1 [/fen]

The tool should do the following:
1)Get a set of 1,000,000 chess positions as input(number can be different and it is only an example) and give me

a)Set of 1000 chess patterns as output(again number can be different)
b)If I give it later a chess position like the position in this thread the tool tell me the patterns that I should use to memorize the position out of the 1000 chess patterns when the target is to express the position as a union of small number of patterns(smaller is better).
Lazy_Frank
Posts: 74
Joined: Mon Jul 23, 2018 10:56 pm
Location: Latvia
Full name: Raivis Baumanis

Re: is there a program to detect patterns from positions?

Post by Lazy_Frank »

Do I understand correctly?

[fen]r4rk1/pbpnqppp/1p6/4p3/2BPP3/2P2N2/P3QPPP/R4RK1 w - - 0 1[/fen]

can by expressed as pattern of ...

[fen]6k1/pbp2ppp/1p6/8/2BPP3/2P5/5PPP/6K1 w - - 0 1[/fen]

?
Uri Blass
Posts: 11125
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: is there a program to detect patterns from positions?

Post by Uri Blass »

Lazy_Frank wrote: Thu Jul 28, 2022 10:17 am Do I understand correctly?

[fen]r4rk1/pbpnqppp/1p6/4p3/2BPP3/2P2N2/P3QPPP/R4RK1 w - - 0 1[/fen]

can by expressed as pattern of ...

[fen]6k1/pbp2ppp/1p6/8/2BPP3/2P5/5PPP/6K1 w - - 0 1[/fen]

?
It can be expressed as union of patterns when this is one of the patterns.
Norm Pollock
Posts: 1079
Joined: Thu Mar 09, 2006 4:15 pm
Location: Long Island, NY, USA

Re: is there a program to detect patterns from positions?

Post by Norm Pollock »

i think that my tool "epdPosition" will satisfy your request. It is in the 40H-EPD toolbox whose link is below in my signature.

Here is a partial description in the readme:

"epdPosition" inputs a user-specified "epd" search file and
an "epd" input data file, then outputs records in the input data
file that match the first and second fields of a position in
the search file.
Updated links for 40H Tools and Databases
http://40Hchess.epizy.com
http://nk-qy.info/40h
Norm Pollock
Posts: 1079
Joined: Thu Mar 09, 2006 4:15 pm
Location: Long Island, NY, USA

Re: is there a program to detect patterns from positions?

Post by Norm Pollock »

A better tool from the same toolbox is "epdMask"

"epdMask" extracts records based on a user-specified "pieces/location
structure" such as "2kr4/8/8/8/8/8/8/2KR4". "epdMask" can also be
used in combination with "PGN-Extract" by David Barnes.
Updated links for 40H Tools and Databases
http://40Hchess.epizy.com
http://nk-qy.info/40h