If there is any research on Goal Based Programming (GBP)?
Yes.  The research area is known as program synthesis.  You can find hundreds or thousands of papers on the subject.  (You might also be interested in declarative programming.)

What you're describing is way beyond the state of the art.  It'd be really cool if we could do something like that -- but we're a long long way away from knowing how to build that.