Learning and Executing Generalized Robot Plans