A Heuristic Programming Study of Theory Formation in Science