Samuel TLG ec10a90635
Simplify: add rules and restructure tests for noncommutative contexts (#2847)
* Simplify: add two (term collection) noncommutative context std. rules

These additions permit the valid application of rules to exprs
including:
- For new rule 'vd + n*vd -> (1+n)*vd'
'a+2*a' ->  '(1+2)*a'

- And new rule 'cd + cd*n -> cd*(1+n)'
'4+4*b' ->  '4*(1+b)'

* Simplify: add non-commutative context term factoring rule

'n^n1 * n -> n^(n1+1)'

Also updates extant NC-context simplify tests which now apply this rule
successfully

* Add and restructure non-default context simplify tests

In addition to refactoring and splitting current tests into
describe/it blocks, also adds test block:
'should still validly apply (term factoring and collection) rules'

For ensuring simplify rules marked with
'context.[add/multiply].commutative: false' apply; simultaneously
validating that simplifications still occur as expected in these
contexts.

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2022-12-05 10:37:16 +01:00
..