Backward Reachability of Array-based Systems by SMT solving: Termination and Invariant Synthesis