Automatic functions, linear time and learning (Logical Methods in Computer Science, 2013)