Higher order distance-like functions and Sobolev spaces