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

[asl] Delay to runtime problematic values in constraint sets #924

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

HadrienRenaud
Copy link
Collaborator

In ASL, division by zero or shift by negative values are dynamic errors.
However, what should happen when trying to apply such operation to a constraint set?

For example, what should be the type of c in:

var a: integer {4, 6, 8, 10};
var b: integer {0, 1, 2};
var c: a DIV b;

This PR says that the type of c, for the purpose of type-checking is the result of all non-faulting division between the constraints of a and the constraints of b, hence: integer {2, 3, 4, 5, 6, 8, 10}.
The removal of 0 from the right hand side of DIV is implemented here as a warning to the user.

@HadrienRenaud HadrienRenaud force-pushed the asl-ignore-div-zero branch 2 times, most recently from f063a17 to 924aa37 Compare August 5, 2024 15:35
@HadrienRenaud HadrienRenaud merged commit c8e0afd into herd:master Aug 8, 2024
3 checks passed
@HadrienRenaud HadrienRenaud deleted the asl-ignore-div-zero branch August 8, 2024 09:52
HadrienRenaud added a commit that referenced this pull request Aug 8, 2024
[ASL] Asl allow more atcs

Follow up on #924.

Also add some tests to testsuite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant