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
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-14 15:55 +0200
1""" Rewrite Rules
3DISCLAIMER: This module is experimental. The interface is subject to change.
5A rule is a function that transforms one expression into another
7 Rule :: Expr -> Expr
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
12 Strategy :: [Rules], Other-stuff -> Rule
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.
18Submodules
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"""
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
35__all__ = [
36 'rl',
38 'traverse',
40 'rm_id', 'unpack', 'flatten', 'sort', 'glom', 'distribute', 'rebuild',
42 'new',
44 'condition', 'debug', 'chain', 'null_safe', 'do_one', 'exhaust',
45 'minimize', 'tryit',
47 'canon', 'typed',
49 'branch',
50]