def solve_step(self):
self.solve_begun = True<EOL>if self.status != SolverStatus.unsolved:<EOL><INDENT>return<EOL><DEDENT>if self.pr:<EOL><INDENT>self.pr.header("<STR_LIT>",<EOL>self.solve_count + <NUM_LIT:1>, self.num_fails)<EOL><DEDENT>phase = self._pop_phase()<EOL>if phase.status == SolverStatus.failed:  <EOL><INDENT>self.pr("<STR_LIT>")<EOL>self.failed_phase_list.append(phase)<EOL>phase = self._pop_phase()<EOL><DEDENT>if phase.status == SolverStatus.exhausted:<EOL><INDENT>self.pr.subheader("<STR_LIT>")<EOL>phase, next_phase = phase.split()<EOL>self._push_phase(next_phase)<EOL>if self.pr:<EOL><INDENT>self.pr("<STR_LIT>", phase)<EOL><DEDENT><DEDENT>new_phase = phase.solve()<EOL>self.solve_count += <NUM_LIT:1><EOL>if new_phase.status == SolverStatus.failed:<EOL><INDENT>self.pr.subheader("<STR_LIT>")<EOL>self._push_phase(new_phase)<EOL>if self.pr and len(self.phase_stack) == <NUM_LIT:1>:<EOL><INDENT>self.pr.header("<STR_LIT>")<EOL><DEDENT><DEDENT>elif new_phase.status == SolverStatus.solved:<EOL><INDENT>self.pr.subheader("<STR_LIT>")<EOL>final_phase = new_phase.finalise()<EOL>self._push_phase(final_phase)<EOL>if self.pr:<EOL><INDENT>if final_phase.status == SolverStatus.cyclic:<EOL><INDENT>self.pr.header("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>self.pr.header("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>self.pr.subheader("<STR_LIT>")<EOL>assert(new_phase.status == SolverStatus.exhausted)<EOL>self._push_phase(new_phase)<EOL><DEDENT>
Perform a single solve step.