Coverage for /usr/lib/python3/dist-packages/sympy/strategies/__init__.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-06-14 15:55 +0200

1""" Rewrite Rules 

2 

3DISCLAIMER: This module is experimental. The interface is subject to change. 

4 

5A rule is a function that transforms one expression into another 

6 

7 Rule :: Expr -> Expr 

8 

9A strategy is a function that says how a rule should be applied to a syntax 

10tree. In general strategies take rules and produce a new rule 

11 

12 Strategy :: [Rules], Other-stuff -> Rule 

13 

14This allows developers to separate a mathematical transformation from the 

15algorithmic details of applying that transformation. The goal is to separate 

16the work of mathematical programming from algorithmic programming. 

17 

18Submodules 

19 

20strategies.rl - some fundamental rules 

21strategies.core - generic non-SymPy specific strategies 

22strategies.traverse - strategies that traverse a SymPy tree 

23strategies.tools - some conglomerate strategies that do depend on SymPy 

24""" 

25 

26from . import rl 

27from . import traverse 

28from .rl import rm_id, unpack, flatten, sort, glom, distribute, rebuild 

29from .util import new 

30from .core import ( 

31 condition, debug, chain, null_safe, do_one, exhaust, minimize, tryit) 

32from .tools import canon, typed 

33from . import branch 

34 

35__all__ = [ 

36 'rl', 

37 

38 'traverse', 

39 

40 'rm_id', 'unpack', 'flatten', 'sort', 'glom', 'distribute', 'rebuild', 

41 

42 'new', 

43 

44 'condition', 'debug', 'chain', 'null_safe', 'do_one', 'exhaust', 

45 'minimize', 'tryit', 

46 

47 'canon', 'typed', 

48 

49 'branch', 

50]