Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplifyCore() could do better with a+-0 #2484

Closed
gwhitney opened this issue Mar 16, 2022 · 1 comment
Closed

simplifyCore() could do better with a+-0 #2484

gwhitney opened this issue Mar 16, 2022 · 1 comment
Labels
category:symbolic Issues regarding symbolic operations like symbolic equation solving or symbolic differentiation feature

Comments

@gwhitney
Copy link
Collaborator

Currently, simplify(parse('a+-0')) returns the expression a - 0. But there is no reason it shouldn't be able to take this all the way down to just a, as it knows that a+-b is a-b and that a-0 is a, and it does not take an extra pass to perform both steps. If there's no objection, I will file a PR that enhances simplifyCore to catch these "sequential steps" cases.

@gwhitney gwhitney added feature category:symbolic Issues regarding symbolic operations like symbolic equation solving or symbolic differentiation labels Mar 16, 2022
@josdejong
Copy link
Owner

Sounds like a logical improvement, thanks 👍

gwhitney added a commit that referenced this issue Mar 20, 2022
   Also adds support for logical operators.
   Resolves #2484.
josdejong pushed a commit that referenced this issue Mar 21, 2022
* refactor: don't simplify constants in simplifyCore

  Keeps the operation of simplifyCore cleanly separate from
  simplifyConstant.

* fix; handle multiple consecutive operations in simplifyCore()

   Also adds support for logical operators.
   Resolves #2484.

* feat: export simplifyConstant

  Now that simplifyCore does not do any constant folding, clients may
  wish to access that behavior via simplifyConstant. Moreover, exporting it
  makes it easier to use in custom rule lists for simplify().

  Also adds docs, embedded docs, and tests for simplifyConstant().

  Also fixes simplifyCore() on logical functions (they always return boolean,
  rather than "short-circuiting").

  Resolves #2459.
gwhitney added a commit that referenced this issue Apr 13, 2022
* refactor: don't simplify constants in simplifyCore

  Keeps the operation of simplifyCore cleanly separate from
  simplifyConstant.

* fix; handle multiple consecutive operations in simplifyCore()

   Also adds support for logical operators.
   Resolves #2484.

* feat: export simplifyConstant

  Now that simplifyCore does not do any constant folding, clients may
  wish to access that behavior via simplifyConstant. Moreover, exporting it
  makes it easier to use in custom rule lists for simplify().

  Also adds docs, embedded docs, and tests for simplifyConstant().

  Also fixes simplifyCore() on logical functions (they always return boolean,
  rather than "short-circuiting").

  Resolves #2459.
gwhitney added a commit that referenced this issue Apr 30, 2022
* refactor: don't simplify constants in simplifyCore

  Keeps the operation of simplifyCore cleanly separate from
  simplifyConstant.

* fix; handle multiple consecutive operations in simplifyCore()

   Also adds support for logical operators.
   Resolves #2484.

* feat: export simplifyConstant

  Now that simplifyCore does not do any constant folding, clients may
  wish to access that behavior via simplifyConstant. Moreover, exporting it
  makes it easier to use in custom rule lists for simplify().

  Also adds docs, embedded docs, and tests for simplifyConstant().

  Also fixes simplifyCore() on logical functions (they always return boolean,
  rather than "short-circuiting").

  Resolves #2459.
gwhitney added a commit that referenced this issue May 12, 2022
* refactor: don't simplify constants in simplifyCore

  Keeps the operation of simplifyCore cleanly separate from
  simplifyConstant.

* fix; handle multiple consecutive operations in simplifyCore()

   Also adds support for logical operators.
   Resolves #2484.

* feat: export simplifyConstant

  Now that simplifyCore does not do any constant folding, clients may
  wish to access that behavior via simplifyConstant. Moreover, exporting it
  makes it easier to use in custom rule lists for simplify().

  Also adds docs, embedded docs, and tests for simplifyConstant().

  Also fixes simplifyCore() on logical functions (they always return boolean,
  rather than "short-circuiting").

  Resolves #2459.
gwhitney added a commit that referenced this issue May 31, 2022
* refactor: don't simplify constants in simplifyCore

  Keeps the operation of simplifyCore cleanly separate from
  simplifyConstant.

* fix; handle multiple consecutive operations in simplifyCore()

   Also adds support for logical operators.
   Resolves #2484.

* feat: export simplifyConstant

  Now that simplifyCore does not do any constant folding, clients may
  wish to access that behavior via simplifyConstant. Moreover, exporting it
  makes it easier to use in custom rule lists for simplify().

  Also adds docs, embedded docs, and tests for simplifyConstant().

  Also fixes simplifyCore() on logical functions (they always return boolean,
  rather than "short-circuiting").

  Resolves #2459.
gwhitney added a commit that referenced this issue May 31, 2022
* refactor: don't simplify constants in simplifyCore

  Keeps the operation of simplifyCore cleanly separate from
  simplifyConstant.

* fix; handle multiple consecutive operations in simplifyCore()

   Also adds support for logical operators.
   Resolves #2484.

* feat: export simplifyConstant

  Now that simplifyCore does not do any constant folding, clients may
  wish to access that behavior via simplifyConstant. Moreover, exporting it
  makes it easier to use in custom rule lists for simplify().

  Also adds docs, embedded docs, and tests for simplifyConstant().

  Also fixes simplifyCore() on logical functions (they always return boolean,
  rather than "short-circuiting").

  Resolves #2459.
gwhitney added a commit that referenced this issue Jul 13, 2022
* refactor: don't simplify constants in simplifyCore

  Keeps the operation of simplifyCore cleanly separate from
  simplifyConstant.

* fix; handle multiple consecutive operations in simplifyCore()

   Also adds support for logical operators.
   Resolves #2484.

* feat: export simplifyConstant

  Now that simplifyCore does not do any constant folding, clients may
  wish to access that behavior via simplifyConstant. Moreover, exporting it
  makes it easier to use in custom rule lists for simplify().

  Also adds docs, embedded docs, and tests for simplifyConstant().

  Also fixes simplifyCore() on logical functions (they always return boolean,
  rather than "short-circuiting").

  Resolves #2459.
gwhitney added a commit that referenced this issue Jul 15, 2022
* refactor: don't simplify constants in simplifyCore

  Keeps the operation of simplifyCore cleanly separate from
  simplifyConstant.

* fix; handle multiple consecutive operations in simplifyCore()

   Also adds support for logical operators.
   Resolves #2484.

* feat: export simplifyConstant

  Now that simplifyCore does not do any constant folding, clients may
  wish to access that behavior via simplifyConstant. Moreover, exporting it
  makes it easier to use in custom rule lists for simplify().

  Also adds docs, embedded docs, and tests for simplifyConstant().

  Also fixes simplifyCore() on logical functions (they always return boolean,
  rather than "short-circuiting").

  Resolves #2459.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:symbolic Issues regarding symbolic operations like symbolic equation solving or symbolic differentiation feature
Projects
None yet
Development

No branches or pull requests

2 participants