<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def trim(self):
 """ Discard the ancestry of this state. """

        new_hist = self.copy({})
        new_hist.parent = None
        self.state.register_plugin('history', new_hist)