__init__.py 1.1 KB

123456789101112131415161718192021222324
  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. 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. RULES = {
  13. OP_ADD: [match_add_constant_fractions, match_combine_polynomes, \
  14. match_combine_groups],
  15. OP_MUL: [match_multiply_numerics, match_expand, match_add_exponents, \
  16. match_expand_and_add_fractions],
  17. OP_DIV: [match_subtract_exponents, match_divide_numerics, \
  18. match_constant_division],
  19. OP_POW: [match_multiply_exponents, match_duplicate_exponent, \
  20. match_remove_negative_exponent, match_exponent_to_root, \
  21. match_extend_exponent],
  22. }