Skip to content

feat(circuit): polymorphic array init binding kind (painit)#1071

Merged
strub merged 1 commit into
mainfrom
bdep-slow
Jul 10, 2026
Merged

feat(circuit): polymorphic array init binding kind (painit)#1071
strub merged 1 commit into
mainfrom
bdep-slow

Conversation

@strub

@strub strub commented Jul 10, 2026

Copy link
Copy Markdown
Member

A raw polymorphic Array.init (e.g. from subarray256 x i = Array256.init (fun k => x.[256*i+k])) had no circuit binding: only the
monomorphic ainit wrapper is bindable, since bind op/ainit fixes the
element width at bind time. So a spec built on Array.init fell into the
reduce-on-demand fallback -- full reduction per element access -- which
could take minutes to translate a single postcondition.

Add a painit bv-operator kind that binds an array init BY PATH while
leaving the element lane-width polymorphic; the width is resolved from the
concrete components when the operator is translated at a concrete element
type.

A raw polymorphic `Array.init` (e.g. from `subarray256 x i =
Array256.init (fun k => x.[256*i+k])`) had no circuit binding: only the
monomorphic `ainit` wrapper is bindable, since `bind op`/`ainit` fixes the
element width at bind time. So a spec built on `Array.init` fell into the
reduce-on-demand fallback -- full reduction per element access -- which
could take minutes to translate a single postcondition.

Add a `painit` bv-operator kind that binds an array `init` BY PATH while
leaving the element lane-width polymorphic; the width is resolved from the
concrete components when the operator is translated at a concrete element
type.
@strub strub self-assigned this Jul 10, 2026
@strub strub requested a review from Gustavo2622 July 10, 2026 11:27
@strub strub enabled auto-merge July 10, 2026 11:27
@strub strub added this pull request to the merge queue Jul 10, 2026
Merged via the queue into main with commit ccff776 Jul 10, 2026
19 checks passed
@strub strub deleted the bdep-slow branch July 10, 2026 12:29
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