Skip to content

Conversation

@Aurel300
Copy link
Owner

@Aurel300 Aurel300 commented May 16, 2025

This PR will add the type encoding (snapshots and predicates) for arrays and slices. The snapshot in both cases is a sequence of s_Param values. The array type additionally constrains this sequence to have a particular length.

The primitive MIR "index" access (i.e., when not using the stdlib Index trait for slicing) is similar to an unfold for struct field access: when the PCG informs us that the Index place is accessible, we call a method that trades the array predicate for a "borrowed" array predicate and the predicate for the specific index. Another method then corresponds to the fold that trades these predicates back for the original array.

To support arrays properly we also need support for const generics. In our encoding, these are special instances of Type that wrap a value of s_Param. These are then passed around like any other generic argument and can even be mentioned in method specifications as values. (Update: this was merged separately in #93.)

@Aurel300 Aurel300 force-pushed the feature/arrays branch 2 times, most recently from 6124755 to 391d7c8 Compare May 22, 2025 13:59
@Aurel300
Copy link
Owner Author

(Superseded by #117.)

@Aurel300 Aurel300 closed this Nov 13, 2025
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