Skip to content

feat: add @[mvcgen_invariant_type] attribute for extensible invariant classification#12874

Merged
sgraf812 merged 4 commits intomasterfrom
mvcgen-invariant-attr
Mar 11, 2026
Merged

feat: add @[mvcgen_invariant_type] attribute for extensible invariant classification#12874
sgraf812 merged 4 commits intomasterfrom
mvcgen-invariant-attr

Conversation

@sgraf812
Copy link
Copy Markdown
Contributor

This PR adds an @[mvcgen_invariant_type] tag attribute so that users can mark
custom types as invariant types for the mvcgen tactic. Goals whose type is an
application of a tagged type are classified as invariants rather than verification
conditions. The hard-coded check for Std.Do.Invariant is kept as a fallback
until a stage0 update allows applying the attribute directly.

A follow-up PR (after a stage0 update) will apply @[mvcgen_invariant_type] to
Std.Do.Invariant and remove the hard-coded fallback.

…nt classification

This PR adds an `@[mvcgen_invariant_type]` tag attribute so that users can mark
custom types as invariant types for the `mvcgen` tactic. Goals whose type is an
application of a tagged type are classified as invariants rather than verification
conditions. The hard-coded check for `Std.Do.Invariant` is kept as a fallback
until a stage0 update allows applying the attribute directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sgraf812 sgraf812 added the changelog-language Language features and metaprograms label Mar 10, 2026
@sgraf812 sgraf812 marked this pull request as draft March 10, 2026 18:08
…iteration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sgraf812 sgraf812 force-pushed the mvcgen-invariant-attr branch from 2fbe9e5 to dbcdfd0 Compare March 11, 2026 06:54
@sgraf812 sgraf812 marked this pull request as ready for review March 11, 2026 06:54
@sgraf812 sgraf812 enabled auto-merge March 11, 2026 06:54
@sgraf812 sgraf812 added this pull request to the merge queue Mar 11, 2026
Merged via the queue into master with commit 220a242 Mar 11, 2026
13 of 15 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Mar 11, 2026
…nt`, `StringSliceInvariant` (#12880)

This PR applies `@[mvcgen_invariant_type]` to `Std.Do.Invariant` and
removes the hard-coded fallback in `isMVCGenInvariantType` that was
needed for bootstrapping (cf. #12874). It also extracts
`StringInvariant` and `StringSliceInvariant` as named abbreviations
tagged with `@[mvcgen_invariant_type]`, so that `mvcgen` classifies
string and string slice loop invariants correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-language Language features and metaprograms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant