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

Only emitting side_conditions if all occurrences of the same variable are equal #1155

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

Robertorosmaninho
Copy link
Collaborator

@Robertorosmaninho Robertorosmaninho commented Oct 10, 2024

In this PR, we inverse the order in which we create the decision tree when a rule has a side condition. Previously, even when we had 2 or more variables with the same name having different values, the side condition decision trees were generated, and we only evaluated the variables matching after evaluating the side condition.

After this PR, we inverse this order and evaluate the variables matching first and then the side condition.
This issue was discovered in the context of side conditions proof events being emitted and being true but without ever being applied, as we have a mismatch in the variable names and values.

This PR fixes: https://github.com/Pi-Squared-Inc/pi2/issues/2124

We added a regression test that reproduced this issue, and it's now fixed!

@Robertorosmaninho Robertorosmaninho self-assigned this Oct 10, 2024
@rv-jenkins rv-jenkins changed the base branch from master to develop October 10, 2024 21:45
@Robertorosmaninho Robertorosmaninho marked this pull request as ready for review October 14, 2024 00:30
@rv-jenkins rv-jenkins merged commit 7ab1dec into develop Oct 17, 2024
10 checks passed
@rv-jenkins rv-jenkins deleted the fix-side-condition-bug branch October 17, 2024 20:02
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