__init__.py 1.2 KB

12345678910111213141516171819202122232425
  1. from ..node import OP_ADD, OP_MUL, OP_DIV, OP_POW, OP_NEG
  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. match_extend_exponent
  9. from .numerics import match_divide_numerics, match_multiply_numerics
  10. from .fractions import match_constant_division, match_add_constant_fractions, \
  11. match_expand_and_add_fractions
  12. from .negation import match_negate_group
  13. RULES = {
  14. OP_ADD: [match_add_constant_fractions, match_combine_polynomes, \
  15. match_combine_groups],
  16. OP_MUL: [match_multiply_numerics, match_expand, match_add_exponents, \
  17. match_expand_and_add_fractions],
  18. OP_DIV: [match_subtract_exponents, match_divide_numerics, \
  19. match_constant_division],
  20. OP_POW: [match_multiply_exponents, match_duplicate_exponent, \
  21. match_remove_negative_exponent, match_exponent_to_root, \
  22. match_extend_exponent],
  23. OP_NEG: [match_negate_group],
  24. }