Skip to content

Add an offset field to the Seq model#163

Open
coord-e wants to merge 1 commit into
claude/seq-concat-tuplefrom
claude/seq-offset-field
Open

Add an offset field to the Seq model#163
coord-e wants to merge 1 commit into
claude/seq-concat-tuplefrom
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. Stacked on top of #162.

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 concat_int_array 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)
  2. concat_int_array takes sequence tuples (Make concat_int_array operate on sequence tuples #162)
  3. this PR — offset field
  4. subsequence + split_first/split_last(_mut)

🤖 Generated with Claude Code

https://claude.ai/code/session_01GzapTuen2mKHkkN3B7d8qi


Generated by Claude Code

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
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