For this work I used the application PyCharm Community Edition 2022.3 as the its simplified form helped me to understand the work and to better implement it her.
In the simplified world of the problem there are four consecutively adjacent cells, numbered from 1 to 4. In some of the cells there may be a unique fruit, but this is not necessary. Also, in one of these four cells there is a pacman that can move to an adjacent cell, left or right. The permissible states in which the problem can be found are determined by the combinations of relations between its objects. A state is determined both by the pacman's cell in any of the cells, and by which cells contain fruit. Any feasible state in which the problem world can be found at the beginning of the problem solution can be defined as the initial state. The goal of the problem is to eat all the fruits and leave pacman alone in one of the 4 cells.