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

Refactor rule parsing #4699

Merged
merged 26 commits into from
Dec 3, 2024
Merged

Refactor rule parsing #4699

merged 26 commits into from
Dec 3, 2024

Conversation

tothtamas28
Copy link
Contributor

@tothtamas28 tothtamas28 commented Dec 2, 2024

  • Remove unnecessary cases
  • Make pattern matching logic more concise
  • Process three cases of simplification rules: AppRule, CeilRule, EqualsRule

@tothtamas28 tothtamas28 self-assigned this Dec 2, 2024
@rv-jenkins rv-jenkins changed the base branch from master to develop December 2, 2024 09:00
@tothtamas28 tothtamas28 marked this pull request as ready for review December 2, 2024 09:10
@tothtamas28 tothtamas28 marked this pull request as draft December 2, 2024 10:33
@tothtamas28 tothtamas28 marked this pull request as ready for review December 2, 2024 13:10
Copy link
Member

@jberthold jberthold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines -205 to +206
case And(ops=(In(right=x), y)):
return (x,) + FunctionRule._get_patterns(y)
case And(ops=(In(left=EVar(), right=arg), rest)):
return (arg,) + FunctionRule._extract_args(rest)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course this relies on the order of arguments being consistent with the order of \in clauses... (before and after your change), but that's probably OK...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. But since everything else also relies on a particular structure of terms, I'll just keep it this way until it causes issues.

@rv-jenkins rv-jenkins merged commit e6a0d1d into develop Dec 3, 2024
18 checks passed
@rv-jenkins rv-jenkins deleted the refactor-rule-parsing branch December 3, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants