4 ms·
My hope is that constraining the search space, you'll also solve the 'common sense' problem. I'm constraining it in three ways: 1) The solver tries to make the
by a-priori 10y ago
My hope is that constraining the search space, you'll also solve the 'common sense' problem. I'm constraining it in three ways:
1) The solver tries to make the tests pass one at a time: it finds a solution that passes test 1, then one that passes tests 1 and 2, then one that passes tests 1, 2 and 3, and so on. So the human-written unit test suite guides the solution quite directly.
2) The search algorithm will be fairly shallow, somewhere between 2 and 3 steps probably. If it can't find a way to get from tests n to n+1 then it'll throw its hands up and ask you to insert a new test in the middle to help it.
3) Rather than trying arbitrary AST mutations or something, each step will be chosen from a vocabulary of transformations that move the solution from specific to generic -- things like "turn this constant into a variable" or "turn this if statement into a while loop" or things like that -- with simpler transformations preferred over more complicated ones (see the Uncle Bob blog post I mentioned).
In addition to making it computationally tractable, my hunch is that constraining the search like this will also make the solutions similar to what a human would write.