Generalized Planning: Non-Deterministic Abstractions and Trajectory Constraints