Added missing calculation for some new Statenodes .
Added const to some functions in planner.
Fixed a bunch of functions for get some specific state node in backward or forward for a rule node.