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

Introduce simplification rules #224

Open
sys27 opened this issue Jun 15, 2019 · 0 comments · May be fixed by #579
Open

Introduce simplification rules #224

sys27 opened this issue Jun 15, 2019 · 0 comments · May be fixed by #579
Assignees
Milestone

Comments

@sys27
Copy link
Owner

sys27 commented Jun 15, 2019

Like:

public class /* struct */ AddZeroSimplifier : BaseSimplifier<Add>
{
    public override IExpression Simplify(Add exp)
    {
        var result = AnalyzeBinaryArgument(exp);

        return result switch
        {
            (Number(var number), _) when number == 0
                => exp.Right,
            (_, Number(var number)) when number == 0
                => exp.Left,
            _ => exp,
        };
    }

    public string Name => "Add zero";

    public string Description => "Removes unnecessary zeros from addition."
}

Simplification steps?

@sys27 sys27 added this to the Backlog milestone Jun 15, 2019
@sys27 sys27 self-assigned this Jun 15, 2019
@sys27 sys27 removed the question label Jul 5, 2019
@sys27 sys27 modified the milestones: Backlog, xFunc 4.2.0 May 23, 2022
sys27 added a commit that referenced this issue Jul 26, 2022
@sys27 sys27 linked a pull request Jul 26, 2022 that will close this issue
sys27 added a commit that referenced this issue Sep 14, 2022
sys27 added a commit that referenced this issue Oct 13, 2022
sys27 added a commit that referenced this issue Oct 13, 2022
sys27 added a commit that referenced this issue Oct 14, 2022
sys27 added a commit that referenced this issue Oct 19, 2022
@sys27 sys27 modified the milestones: xFunc 4.2.0, xFunc 4.3.0 Dec 14, 2022
sys27 added a commit that referenced this issue Jun 24, 2023
sys27 added a commit that referenced this issue Jul 6, 2023
sys27 added a commit that referenced this issue Jul 15, 2023
@sys27 sys27 modified the milestones: xFunc 4.3.0, Backlog Aug 5, 2023
sys27 added a commit that referenced this issue Aug 23, 2023
sys27 added a commit that referenced this issue Dec 20, 2023
sys27 added a commit that referenced this issue Dec 20, 2023
sys27 added a commit that referenced this issue Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant