A Biologically Inspired Program-Level Imitation Approach for Robots