__init__.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. """ Rewrite Rules
  2. DISCLAIMER: This module is experimental. The interface is subject to change.
  3. A rule is a function that transforms one expression into another
  4. Rule :: Expr -> Expr
  5. A strategy is a function that says how a rule should be applied to a syntax
  6. tree. In general strategies take rules and produce a new rule
  7. Strategy :: [Rules], Other-stuff -> Rule
  8. This allows developers to separate a mathematical transformation from the
  9. algorithmic details of applying that transformation. The goal is to separate
  10. the work of mathematical programming from algorithmic programming.
  11. Submodules
  12. strategies.rl - some fundamental rules
  13. strategies.core - generic non-SymPy specific strategies
  14. strategies.traverse - strategies that traverse a SymPy tree
  15. strategies.tools - some conglomerate strategies that do depend on SymPy
  16. """
  17. from . import rl
  18. from . import traverse
  19. from .rl import rm_id, unpack, flatten, sort, glom, distribute, rebuild
  20. from .util import new
  21. from .core import (
  22. condition, debug, chain, null_safe, do_one, exhaust, minimize, tryit)
  23. from .tools import canon, typed
  24. from . import branch
  25. __all__ = [
  26. 'rl',
  27. 'traverse',
  28. 'rm_id', 'unpack', 'flatten', 'sort', 'glom', 'distribute', 'rebuild',
  29. 'new',
  30. 'condition', 'debug', 'chain', 'null_safe', 'do_one', 'exhaust',
  31. 'minimize', 'tryit',
  32. 'canon', 'typed',
  33. 'branch',
  34. ]