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

CN: Separate well-typed and consistency checks #797

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

dc-mak
Copy link
Contributor

@dc-mak dc-mak commented Dec 27, 2024

WellTyped/well-formedness checks were intertwined with the typing monad because they also performed consistency checks. This made running just the well-formedness checks slower, and did not allow users to opt-out of running the consistency check.

This commit adds variants consistent functions, which are variants on the welltyped functions. The latter add variables to scope and check basetypes; the former add variables to scope, constraints and resources.

It also tidies up the wellTyped.ml module to clarify and restrict which of the typing monad functions it was using. This will be the first step of many to factor out the logging and the error reporting for different phases.

This commit also required an update to the pure function in the typing monad, so that it can work without a solver (functionality with a solver initialised should be unaffected).

Slightly awkwardly, the reshuffle also required gathering and delaying adding the range constraints for global variables, since adding constraints and resources both require the solver to be initialised.

This can and should be tidied up, which will come in subsequent commits, but for now this should pass all tests.

WellTyped/well-formedness checks were intertwined with the typing monad
because they also performed consistency checks. This made running just
the well-formedness checks slower, and did not allow users to opt-out
of running the consistency check.

This commit adds variants `consistent` functions, which are variants
on the `welltyped` functions. The latter add variables to scope and
check basetypes; the former add variables to scope, constraints
and resources.

It also tidies up the wellTyped.ml module to clarify and restrict which
of the typing monad functions it was using. This will be the first step
of many to factor out the logging and the error reporting for different
phases.

This commit also required an update to the `pure` function in the typing
monad, so that it can work without a solver (functionality with a
solver initialised should be unaffected).

Slightly awkwardly, the reshuffle also required gathering and delaying
adding the range constraints for global variables, since adding
constraints and resources both require the solver to be initialised.

This can and should be tidied up, which will come in subsequent
commits, but for now this should pass all tests.
@dc-mak dc-mak force-pushed the cn-separate-bt-consistency branch from f75629f to 40a0164 Compare December 27, 2024 14:30
dc-mak added a commit to dc-mak/cn-tutorial that referenced this pull request Dec 27, 2024
dc-mak added a commit to rems-project/cn-tutorial that referenced this pull request Dec 27, 2024
@dc-mak dc-mak marked this pull request as ready for review December 27, 2024 21:37
@dc-mak dc-mak merged commit 2ac0695 into rems-project:master Dec 27, 2024
4 checks passed
@dc-mak dc-mak deleted the cn-separate-bt-consistency branch December 27, 2024 21:39
dc-mak added a commit to dc-mak/cn-tutorial that referenced this pull request Dec 27, 2024
dc-mak added a commit to dc-mak/cn-tutorial that referenced this pull request Dec 27, 2024
dc-mak added a commit to rems-project/cn-tutorial that referenced this pull request Dec 27, 2024
dc-mak added a commit to dc-mak/cerberus that referenced this pull request Dec 28, 2024
PR rems-project#797 split out the consistency and welltyped checks for a few
constructs, but accidentally removed the consistency checks for labels.
This commit adds them back.

This commit also deletes some code which was made redundant by aba34a0,
but was not deleted in that commit.
dc-mak added a commit to dc-mak/cerberus that referenced this pull request Dec 29, 2024
PR rems-project#797 split out the consistency and welltyped checks for a few
constructs, but accidentally removed the consistency checks for labels.
This commit adds them back.

This commit also deletes some code which was made redundant by aba34a0,
but was not deleted in that commit.
dc-mak added a commit that referenced this pull request Dec 29, 2024
PR #797 split out the consistency and welltyped checks for a few
constructs, but accidentally removed the consistency checks for labels.
This commit adds them back.

This commit also deletes some code which was made redundant by aba34a0,
but was not deleted in that commit.
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