Trail frames are used to undo bindings of variables when a program backtracks. The trail frame gives the variable and the value that it needs to be restored to.