Skip to content

Sum and Product evaluates zeros and ones #11

Description

@legendre6891

Right now, the Sum and Product primitives do a little bit of calculation on their own. For example, Sum(<anything>, 0) === <anything>. Unfortunately, this process is already carried out in parse so the user can't intervene:

parse(A + 0) = Variable(A) and parse(A * 1) = Variable(A)

This makes the implicit assumption that 0 is always the identity corresponding to the operator denoted by +, and that 1 is always the identity corresponding to the operator denoted by *.

This assumption doesn't always hold (example).

Can you add an option to parse so that parse(A + 0) come out to be Sum(Variable('A'), 0)?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions