I want to make a program that can identify chess tactics in the position, while searching moves according to given heuristics. but I am not sure exactly how to go about this. Related to this Is there a chess engine that does NOT use brute-force search?.
For example let's analyze this position:
[FEN "5rk1/p2Q1ppp/1q2pb2/2rp1b2/5B2/P1N1P3/1P3PPP/R4RK1 w - - 0 1"]
The best move is Na4 forking rook and queen. But Bd6 also forks two rooks but leads to a bad position. A train of thought could be like:
If Bd6 attacks two rooks, Rxc3 captures knight; If bxc3 captures rook, Rd8 skewers queen and bishop on d6, If Bc7 attacks the queen, Rxd7, Bxb6 axb6 If Bxf8, Rc7 attacks the queen, If Qe8 defends bishop, Qc6 attacks Qe8, If Qb8 moves the queen, Rc8 attacks queen and bishop.
In this position single move Na4 has the tactical motive of double attack, which should be fairly easy to spot. But it will also spot Bd6 move as a double attack, but needs to be searched further to decide that it's not working, maybe we need to spot all the other moves as uninteresting and not include in the output or the search.
A simple way to get started is to identify about pins, skewers, attacks, pressures, hanging pieces etc. Apart from that, I am not sure what the next step should be, I mean I don't even know what the input and output should be to this program.
Is a single position enough to identify a tactical motif or a line needs to be given as input, in which case I need to come up with the best lines as well.