Add framework for auto getting backward patterns