Skip to content

Implement more expressions in formula_fn#68

Merged
coord-e merged 3 commits intomainfrom
coord-e/more-formula-fn-expr
Apr 30, 2026
Merged

Implement more expressions in formula_fn#68
coord-e merged 3 commits intomainfrom
coord-e/more-formula-fn-expr

Conversation

@coord-e
Copy link
Copy Markdown
Owner

@coord-e coord-e commented Apr 30, 2026

follow-up of #65
extracted from #57

@coord-e coord-e requested a review from Copilot April 30, 2026 02:51
@coord-e coord-e force-pushed the coord-e/more-formula-fn-expr branch from 25ec1a4 to 3d7a24a Compare April 30, 2026 02:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Follow-up to #65/#57 to expand the set of Rust expressions supported inside #[thrust::formula_fn], primarily around array operations and additional term constructors.

Changes:

  • Add Array indexing and Array::store model definitions and wire up DefId lookup for array_store.
  • Extend AnnotFnTranslator to translate &expr, *expr on shared refs, array[index], array.store(i, v), and struct constructors.
  • Adjust the injected model Vec representation (length uses Int) and add missing Model impl for model::Array.

Reviewed changes

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

File Description
std.rs Adds Array indexing + store model hooks; tweaks model Vec and adds Model for model::Array.
src/analyze/did_cache.rs Caches the DefId for the #[thrust::def::array_store]-annotated method.
src/analyze/annot_fn.rs Implements new HIR-to-CHC translations for index/method-call/address-of/deref and struct ctors.
src/analyze/annot.rs Adds the attribute path helper for thrust::def::array_store.

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

Comment thread src/analyze/annot_fn.rs
Comment thread src/analyze/annot_fn.rs
@coord-e coord-e changed the title Implement more annotation expressions Implement more expressions in formula_fn Apr 30, 2026
@coord-e coord-e merged commit a1159c5 into main Apr 30, 2026
6 checks passed
@coord-e coord-e deleted the coord-e/more-formula-fn-expr branch April 30, 2026 11:57
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