Skip to content

Add an offset field to the Seq model#163

Draft
coord-e wants to merge 1 commit into
mainfrom
claude/seq-offset-field
Draft

Add an offset field to the Seq model#163
coord-e wants to merge 1 commit into
mainfrom
claude/seq-offset-field

Conversation

@coord-e

@coord-e coord-e commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

PR 3 of 4 restructuring #153. Now that #161 and #162 are merged, this is based directly on main.

Sequences now carry an offset in addition to array and length, letting several views share one underlying array while keeping their own logical start.

Details

  • Indexing reads array[offset + i]; push writes at offset + length; empty / singleton and freshly built array literals start at offset 0; and concat keeps the first sequence's offset and appends the second's elements right after it.
  • The seq_concat SMT definition and the select peephole thread the offset through.
  • The Vec and slice extern specs and their tests refer to the new field.

Validation

  • cargo build, cargo fmt --all -- --check, cargo clippy -- -D warnings
  • cargo test — Spacer-backed tests pass (unchanged set from earlier PRs).
  • The offset-aware define-fun-rec was again ground-checked with z3 (non-zero offsets concatenate correctly). PCSat-backed tests require the CoAR Docker image and were not run here.

Stack

  1. named fields (Give the Seq model named array and length fields #161, merged)
  2. seq concatenation on sequence tuples (Make seq concatenation operate on sequence tuples #162, merged)
  3. this PR — offset field
  4. subsequence + split_first/split_last(_mut) (Add subsequence and slice split operations #164)

🤖 Generated with Claude Code

https://claude.ai/code/session_01GzapTuen2mKHkkN3B7d8qi

@coord-e coord-e force-pushed the claude/seq-concat-tuple branch from 8b1d9a7 to e14038b Compare July 2, 2026 01:22
@coord-e coord-e force-pushed the claude/seq-offset-field branch from aa50d26 to 0c6bb28 Compare July 2, 2026 01:24
@coord-e coord-e force-pushed the claude/seq-concat-tuple branch from e14038b to ee5d0b2 Compare July 2, 2026 06:42
@coord-e coord-e force-pushed the claude/seq-offset-field branch from 0c6bb28 to 31252b3 Compare July 2, 2026 06:46
Base automatically changed from claude/seq-concat-tuple to main July 2, 2026 09:57
Sequences now carry an `offset` in addition to `array` and `length`,
letting several views share one underlying array while keeping their own
logical start. Indexing reads `array[offset + i]`; `push` writes at
`offset + length`; `empty`/`singleton` and freshly built array literals
start at offset 0; and `concat` keeps the first sequence's offset and
appends the second's elements right after it.

The `concat_int_array` SMT definition and the select peephole are updated
to thread the offset through, and the Vec and slice extern specs and their
tests refer to the new field.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzapTuen2mKHkkN3B7d8qi
@coord-e coord-e force-pushed the claude/seq-offset-field branch from 31252b3 to ef0e148 Compare July 2, 2026 11:46
@coord-e coord-e marked this pull request as draft July 4, 2026 16: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