Skip to content

Reporting labels that declare invariants but aren't loop heads#920

Merged
marcoeilers merged 2 commits into
masterfrom
meilers_non_loop_head_inv_warnings
Jul 8, 2026
Merged

Reporting labels that declare invariants but aren't loop heads#920
marcoeilers merged 2 commits into
masterfrom
meilers_non_loop_head_inv_warnings

Conversation

@marcoeilers

Copy link
Copy Markdown
Contributor

Returns additional information s.t. the caller (Carbon) has the needed information to emit warnings when the verified program contains labels with invariants that aren't loop heads.
These invariants are ignored, currently completely silently, which can be surprising for users.

The corresponding Silicon and Carbon PRs viperproject/carbon#587 and viperproject/silicon#988 should be merged first.

@Aurel300

Aurel300 commented Jul 8, 2026

Copy link
Copy Markdown
Member

The PRs LGTM, though I would be in favour of making this an error rather than a warning. I can't imagine a case where an invariant is emitted on a non-loop-head label where this is not the result of something going very wrong in the frontend.

@marcoeilers

Copy link
Copy Markdown
Contributor Author

I'll merge the warning code for now. We should put it on the agenda for the next Viper meeting and decide whether it should be an error. I'm in no way against that, I just think it warrants a short discussion.

@marcoeilers
marcoeilers merged commit e23c043 into master Jul 8, 2026
6 of 7 checks passed
@marcoeilers
marcoeilers deleted the meilers_non_loop_head_inv_warnings branch July 8, 2026 12:08
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.

2 participants