What do you do in your brain when you get something wrong?
As for encoding enough rules to handle things as well as a human, what things? Humans don't work with infinite knowledge so there must be a set of rules (however large) that would be "enough".