Programming by demonstration: an inductive learning formulation