Adaptive dynamic programming for finite-horizon optimal control of linear time-varying discrete-time systems