Learning sequential patterns from graphical programs