5728 def _reduce(self):
5729 """Reduce this expression by evaluating its static parts.
5730
5731 If the whole expression is static, proceed as normal for an <apply>.
5732 Otherwise check if the exponent is static and the expression being exponentiated
5733 is a <ci>. If so, and the exponent is equal to 2, 3, or 4, convert the expression
5734 to a multiplication.
5735 """
5736 app = self.xml_parent
5737 bt = app._get_binding_time()
5738 converted = False
5739 if bt != BINDING_TIMES.static and self.model.get_option('pe_convert_power'):
5740 base, expt = list(app.operands())
5741 expt_bt = app._get_element_binding_time(expt)
5742 if expt_bt == BINDING_TIMES.static and isinstance(base, mathml_ci):
5743 expt_val = self.eval(expt)
5744 if expt_val in [2,3,4]:
5745
5746 app.safe_remove_child(base)
5747 operands = [base]
5748 for _ in range(1, expt_val):
5749 operands.append(base.clone_self())
5750 base.variable._used()
5751 new_app = mathml_apply.create_new(app, u'times', operands)
5752 app.replace_child(app, new_app, app.xml_parent)
5753
5754 new_app._reduce()
5755 converted = True
5756 if not converted:
5757
5758 app._reduce(check_operator=False)
5759