Conversation
0acf1b4 to
64291aa
Compare
a4be706 to
1eba386
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends #[thrust::formula_fn] translation to cover (1) existential quantification via an exists helper and (2) enum variant constructors, enabling requires/ensures specifications to mention these constructs directly in Rust expressions (continuing the work from #57 / #65).
Changes:
- Add
thrust_models::exists(...)as a definitional hook and teachAnnotFnTranslatorto translateexists(|...| ...)intochc::Formula::exists. - Add enum variant-constructor term translation (
X::A(...), unit variants, etc.) to formula_fn translation. - Add UI pass/fail tests validating existential and enum usage in formula_fn annotations.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/analyze/annot_fn.rs |
Adds TypeBuilder usage, enum constructor term translation, and exists closure lowering to CHC existentials. |
src/analyze/did_cache.rs |
Caches the DefId for the new #[thrust::def::exists] hook. |
src/analyze/annot.rs |
Adds the attribute path helper for thrust::def::exists. |
std.rs |
Introduces the #[thrust::def::exists] stub in the injected thrust_models module. |
tests/ui/pass/annot_exists_formula_fn.rs |
New passing test for existential quantification in formula_fn ensures. |
tests/ui/fail/annot_exists_formula_fn.rs |
New failing test ensuring existential postcondition is rejected when not satisfied. |
tests/ui/pass/annot_enum_simple_formula_fn.rs |
New passing test for enum constructor equality in formula_fn requires. |
tests/ui/fail/annot_enum_simple_formula_fn.rs |
New failing counterpart for the enum constructor formula_fn test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1eba386 to
1162a2d
Compare
1162a2d to
889b84e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
for #57
continued from #65