Skip to content

Support forall in annotation#141

Merged
coord-e merged 1 commit into
mainfrom
coord-e/forall
Jun 18, 2026
Merged

Support forall in annotation#141
coord-e merged 1 commit into
mainfrom
coord-e/forall

Conversation

@coord-e

@coord-e coord-e commented Jun 18, 2026

Copy link
Copy Markdown
Owner

supported in PCSat in the same way as existentials

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for forall in Thrust annotations (mirroring existing exists support), including end-to-end translation into CHC formulas and SMT-LIB2 output, plus UI tests to validate both satisfiable and unsatisfiable cases.

Changes:

  • Introduces thrust_models::forall and resolves it via a new forall_path + DefIdCache::forall() lookup.
  • Extends CHC AST/printing to represent and emit forall (Formula::Forall) and generalizes quantified variables (Term::FormulaQuantifiedVar).
  • Adds UI pass/fail tests exercising forall inside #[thrust_macros::ensures(...)].

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/ui/pass/annot_forall.rs Adds a passing UI test using forall in an ensures annotation.
tests/ui/fail/annot_forall.rs Adds a failing UI test expecting an Unsat outcome for a forall annotation.
std.rs Adds thrust_models::forall annotated with #[thrust::def::forall].
src/rty.rs Ensures type-parameter substitution traverses Formula::Forall and uses the renamed quantified-var term.
src/chc/unbox.rs Adds unboxing support for Formula::Forall and renames the quantified-var term.
src/chc/smtlib2.rs Emits SMT-LIB2 for forall and renames the quantified-var term printing.
src/chc/format_context.rs Updates sort-collection logic for the renamed quantified-var term.
src/chc.rs Adds Formula::Forall, pretty-printing, and renames the quantified-var term (but currently has pattern-matching compile issues).
src/annot.rs Uses FormulaQuantifiedVar for sorted identifiers in annotations.
src/analyze/did_cache.rs Caches and exposes the forall DefId lookup.
src/analyze/annot.rs Adds forall_path() attribute path helper.
src/analyze/annot_fn.rs Translates `forall(

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/chc.rs
Comment thread src/chc.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78631c839e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/analyze/annot.rs
@coord-e coord-e merged commit 70846d7 into main Jun 18, 2026
7 checks passed
@coord-e coord-e deleted the coord-e/forall branch June 18, 2026 11:07
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