Constraint learning for control tasks with limited duration barrier functions. (May 2021)