Added checking if a rule is able to help current subgoal directly.
Added sorting the preconditions at every planning step,so as to select next subgoal from easy to hard.