Skip to content

Fix OrderMul for negative numeric factors - #62

Open
chessing234 wants to merge 1 commit into
teorth:mainfrom
chessing234:fix/ordermul-negative-scalar
Open

chessing234 wants to merge 1 commit into
teorth:mainfrom
chessing234:fix/ordermul-negative-scalar

Conversation

@chessing234

@chessing234 chessing234 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • OrderMul was wrapping every factor in Theta, so (-1)*Theta(x) became ⊥*Theta(x) instead of matching -Theta(x).
  • Nonzero numeric coefficients are absorbed (positive) or applied as a FormalSub sign (negative), consistent with __neg__.
  • Adds a small unit test for scalar multiplication.

Test plan

  • PYTHONPATH=src pytest tests/test_order_mul.py
  • Confirm (-1)*Theta(x) == FormalSub(0, Theta(x)) and 2*Theta(x) == Theta(x)

Multiplying an order by a negative scalar no longer routes through Theta
(which produced Undefined); negatives use FormalSub like __neg__.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant