Let a be a compact set, then you can define f: a->; R, f(x)=inf|x-Y|, Y∈B, and verify that d(A, B)=inf f(x)=min f(x).
It is not difficult to give an example, but you must find an unbounded closed set.
A={(x,y):x & gt; 0,y & gt= 1/x}
B={(x,y):x & gt; 0,y & lt=- 1/x}
d(A,B)=0