Opening the AI black box: program synthesis via mechanistic interpretability