Efficient weakest preconditions