?- node2path( n(ls, n(cc, n(gp, n(bs, -1)))),Z).
Z = [ls, cc, gp, bs]
Note that the path is reversed. To reverse it we can use the builtin reverse/2.
Exercise. Give a definition of reverse/2.