changed pl-solve-one, pl-solve-all, bagof and setof to be a bit more dynamic, functiony