@internal<EOL><INDENT>def _try_reduce(self) -> Tuple[List["<STR_LIT>"], bool]:<DEDENT>
io_change = False<EOL>new_cases = []<EOL>for val, statements in self.cases:<EOL><INDENT>_statements, rank_decrease, _io_change = self._try_reduce_list(<EOL>statements)<EOL>io_change |= _io_change<EOL>self.rank -= rank_decrease<EOL>new_cases.append((val, _statements))<EOL><DEDENT>self.cases = new_cases<EOL>if self.default is not None:<EOL><INDENT>self.default, rank_decrease, _io_change = self._try_reduce_list(<EOL>self.default)<EOL>self.rank -= rank_decrease<EOL>io_change |= _io_change<EOL><DEDENT>reduce_self = not self._condHasEffect()<EOL>if reduce_self:<EOL><INDENT>if self.cases:<EOL><INDENT>res = self.cases[<NUM_LIT:0>][<NUM_LIT:1>]<EOL><DEDENT>elif self.default is not None:<EOL><INDENT>res = self.default<EOL><DEDENT>else:<EOL><INDENT>res = []<EOL><DEDENT><DEDENT>else:<EOL><INDENT>res = [self, ]<EOL><DEDENT>self._on_reduce(reduce_self, io_change, res)<EOL>if not self.default:<EOL><INDENT>t = self.switchOn._dtype<EOL>if isinstance(t, HEnum):<EOL><INDENT>dom_size = t.domain_size()<EOL>val_cnt = len(t._allValues)<EOL>if len(self.cases) == val_cnt and val_cnt < dom_size:<EOL><INDENT>_, stms = self.cases.pop()<EOL>self.default = stms<EOL><DEDENT><DEDENT><DEDENT>return res, io_change<EOL>
Doc on parent class :meth:`HdlStatement._try_reduce`