Cache the last satisfying assignment on a path

Original title "Implemented the saving of satisfying assignments
to reduce queries"; edited by SMcC to avoid spurious white
space changes.