How is goal expansion for closures defined?

This is pretty much on topic. It explains the problems with goal expansion.