path_formula function

Turn a path object into an expression