Repository navigation
Commit 7c642ce
Seven rules say how much they expand (#1159)
Seven rules say how much they expand
Growth is `Unknown` for a code replacement unless it is declared, and 262 rules
sat there. Seven of them can say what they do, each argued from the shape of the
replacement rather than from the corpus, and each measured against the corpus as
well.
Two mechanisms, the same arithmetic. Six are negation rules -- (-a) + (-b),
(-a) - x, and the four that bring a negative factor out of a product, a
numerator or a denominator -- where the operators map one for one, the literal
is replaced by its magnitude, and the negation the replacement puts round the
whole of it is two nodes. The seventh is a ^ n = 1 / a ^ (-n), where the power
stays a power with its exponent replaced one for one and the quotient and its
numerator are the two.
Expands rather than the other two on purpose, and not only because it is what
they do. Saturation.RulesUpTo builds its set as the rules up to Rearranges, so
Collects and Rearranges are declarations that change which rules equality
saturation fires while Expands is one that does not. These seven record what was
already true without moving anything, which is the right first batch; the ones
that would change the saturation want it measured before and after, and that is
a separate change.
An eighth was measured at +2 on all 18 of its firings and is left alone.
`a-negated-reciprocal-rational-factor-is-a-negated-division` counts five nodes to
five when I work through its pattern, so the measurement and the reading disagree
and I cannot argue the claim. WritingARule.md says to leave such a rule Unknown,
and that applies to the person who wrote the sentence.
Full suite 9552 passed, 0 failed.
Part of #825.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura1 parent 2cff37e commit 7c642ce
3 files changed
Lines changed: 39 additions & 9 deletions
File tree
- Sources
- AngouriMath
- Core/Transformations/Matching
- Docs/Contributing
- Tests/UnitTests/Core/Transformations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
| |||
924 | 930 | | |
925 | 931 | | |
926 | 932 | | |
927 | | - | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
928 | 938 | | |
929 | 939 | | |
930 | 940 | | |
| |||
964 | 974 | | |
965 | 975 | | |
966 | 976 | | |
967 | | - | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
968 | 982 | | |
969 | 983 | | |
970 | 984 | | |
| |||
996 | 1010 | | |
997 | 1011 | | |
998 | 1012 | | |
999 | | - | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1000 | 1019 | | |
1001 | 1020 | | |
1002 | 1021 | | |
| |||
1008 | 1027 | | |
1009 | 1028 | | |
1010 | 1029 | | |
1011 | | - | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1012 | 1035 | | |
1013 | 1036 | | |
1014 | 1037 | | |
| |||
1020 | 1043 | | |
1021 | 1044 | | |
1022 | 1045 | | |
1023 | | - | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1024 | 1050 | | |
1025 | 1051 | | |
1026 | 1052 | | |
| |||
1034 | 1060 | | |
1035 | 1061 | | |
1036 | 1062 | | |
1037 | | - | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1038 | 1068 | | |
1039 | 1069 | | |
1040 | 1070 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
0 commit comments