Indeed, the optimal grammar would be one in which each tree pair in the training data is its own rule.
proposals for using EM for this task start with a precomputed subset of rules, and with EM used just to assign weights within this grammar.