__init__.py 1020 B

12345678910111213141516171819202122
  1. from ..node import OP_ADD, OP_MUL, OP_DIV, OP_POW
  2. from .poly import match_combine_polynomes
  3. from .groups import match_combine_groups
  4. from .factors import match_expand
  5. from .powers import match_add_exponents, match_subtract_exponents, \
  6. match_multiply_exponents, match_duplicate_exponent, \
  7. match_remove_negative_exponent, match_exponent_to_root
  8. from .numerics import match_divide_numerics
  9. from .fractions import match_constant_division, match_add_constant_fractions, \
  10. match_expand_and_add_fractions
  11. RULES = {
  12. OP_ADD: [match_add_constant_fractions, match_combine_groups, \
  13. match_combine_polynomes],
  14. OP_MUL: [match_expand, match_add_exponents, \
  15. match_expand_and_add_fractions],
  16. OP_DIV: [match_subtract_exponents, match_divide_numerics, \
  17. match_constant_division],
  18. OP_POW: [match_multiply_exponents, match_duplicate_exponent, \
  19. match_remove_negative_exponent, match_exponent_to_root],
  20. }