Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
2a3e3ec6
Commit
2a3e3ec6
authored
Nov 17, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lowered precedences of expansion and exponent extension
parent
63b9dd96
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
src/rules/precedences.py
src/rules/precedences.py
+10
-7
No files found.
src/rules/precedences.py
View file @
2a3e3ec6
...
@@ -24,7 +24,7 @@ from .negation import double_negation, negated_factor, negated_nominator, \
...
@@ -24,7 +24,7 @@ from .negation import double_negation, negated_factor, negated_nominator, \
from
.fractions
import
multiply_with_fraction
,
divide_fraction_by_term
,
\
from
.fractions
import
multiply_with_fraction
,
divide_fraction_by_term
,
\
add_nominators
,
division_by_one
add_nominators
,
division_by_one
from
.integrals
import
factor_out_constant
,
integrate_variable_root
from
.integrals
import
factor_out_constant
,
integrate_variable_root
from
.powers
import
remove_power_of_one
from
.powers
import
remove_power_of_one
,
extend_exponent
from
.sqrt
import
quadrant_sqrt
,
extract_sqrt_mult_priority
from
.sqrt
import
quadrant_sqrt
,
extract_sqrt_mult_priority
from
.lineq
import
substitute_variable
,
swap_sides
,
divide_term
,
multiply_term
from
.lineq
import
substitute_variable
,
swap_sides
,
divide_term
,
multiply_term
from
.groups
import
combine_groups
from
.groups
import
combine_groups
...
@@ -62,13 +62,20 @@ LOW = [
...
@@ -62,13 +62,20 @@ LOW = [
factor_in_exponent_multiplicant
,
factor_in_exponent_multiplicant
,
reduce_fraction_constants
,
reduce_fraction_constants
,
# These rules lead to a longer expression, and are therefore not
# preferred as a first step
# Expand 'single' before 'double' to avoid unnessecary complexity
extend_exponent
,
expand_single
,
expand_double
,
# Sorting expression terms has a low priority because it is assumed to
# Sorting expression terms has a low priority because it is assumed to
# be handled by the user
# be handled by the user
swap_factors
,
swap_factors
,
]
]
# Fu
cn
tion precedences relative to eachother. Tuple (A, B) means that A has a
# Fu
nc
tion precedences relative to eachother. Tuple (A, B) means that A has a
# higher priority than B. This list ignores occurences in the HIGH or LOW lists
# higher priority than B. This list ignores occurences in the HIGH or LOW lists
# above
# above
RELATIVE
=
[
RELATIVE
=
[
...
@@ -76,10 +83,6 @@ RELATIVE = [
...
@@ -76,10 +83,6 @@ RELATIVE = [
(
chain_rule
,
raised_base
),
(
chain_rule
,
raised_base
),
(
raised_base
,
factor_out_exponent
),
(
raised_base
,
factor_out_exponent
),
# Combine groups before expanding them
# Expand 'single' before 'double' to avoid unnessecary complexity
(
expand_single
,
expand_double
),
(
factor_out_exponent_important
,
raise_numerics
),
(
factor_out_exponent_important
,
raise_numerics
),
(
factor_out_constant
,
multiply_with_fraction
),
(
factor_out_constant
,
multiply_with_fraction
),
...
@@ -104,7 +107,7 @@ RELATIVE = [
...
@@ -104,7 +107,7 @@ RELATIVE = [
# When solving of an equation with constants, expanding an equation has
# When solving of an equation with constants, expanding an equation has
# a lower priority
# a lower priority
(
divide_term
,
multiply_term
,
swap_sides
,
expand_double
,
expand_single
),
(
divide_term
,
multiply_term
,
swap_sides
),
]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment