The heuristic is this-

Given a problem P-

1. Provide a list(S) of solutions(S1, S2 ... SN) ordered in the most efficient(For some definition of efficiency) implementation means possible.

2. Execute S1, ... SN.

3. If P is fixed by a solution in the list, halt.

4. Else for each S1 ... SN , execute steps 1 through 4 until, all dependencies and sub problems are resolved to eventually solve P.

This obviously needs lots of tokens, which is all the more reason why we need AI to run locally on our machines.