5612 def _reduce(self):
5613 """Reduce this expression by evaluating its static parts.
5614
5615 If the whole expression is static, proceed as normal for an
5616 <apply>. If just the denominator is static, transform the
5617 expression into a multiplication.
5618 """
5619 app = self.xml_parent
5620 bt = app._get_binding_time()
5621 if bt == BINDING_TIMES.static:
5622
5623 app._reduce(check_operator=False)
5624 else:
5625
5626 ops = list(app.operands())
5627 if len(ops) != 2:
5628 self.wrong_number_of_operands(len(ops), [2])
5629 bt = app._get_element_binding_time(ops[1])
5630 if bt == BINDING_TIMES.static:
5631
5632 dummy = self.xml_create_element(u'dummy', NSS[u'm'])
5633 app.replace_child(ops[1], dummy)
5634 new_expr = mathml_apply.create_new(
5635 self, u'divide', [(u'1', u'dimensionless'),
5636 ops[1]])
5637 app.replace_child(dummy, new_expr)
5638 app._reduce_elt(new_expr)
5639
5640 times = self.xml_create_element(u'times', NSS[u'm'])
5641 app.replace_child(self, times)
5642
5643 app._reduce(check_operator=False)
5644 else:
5645
5646 app._reduce(check_operator=False)
5647