basic framework for backtracking in the elaborator