Decide the element type of a loop's list when rounds differ

Open
#393 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
documentation

Research direction

Read Sections 2.1, 2.2 (rule 5), 3.2 (Table 4a), and 4.3 of docs/SPEC_ambyte-core-semantics-v0.md, then check the join.collect branch of fire in crates/ambyte-oracle/src/evaluator/mod.rs for the current behavior. Decide how differing round types are handled and record the evidence or owed witness; the acceptance criteria require the specification to state admission and run-time dispositions.

Written by the indexing model from the issue text.

Description

enhancement type: goalpost

Title: Decide whether a loop without a fold may collect values of different types

.dag: issue-dag/2
.id: ambyte-lang/ambyte#393
.kind: task
.type: decision
.blocked_by: []
.size_hours: 3

Decision

Outcome

The Ambyte specification says what a loop without a fold produces when its rounds give values of different types, so that every admitted plan's value is in the declared value domain.

Scope

Sections 2.1, 2.2 (rule 5), 3.2 (Table 4a) and 4.3 of docs/SPEC_ambyte-core-semantics-v0.md, for the first profile.

Out of scope

  • The typed-atom profile's new kinds. Rule P1 (Section 1.5, flyingrobots/amblicit#386) already makes them non-elements of any list.
  • The L1 proof text.

Prerequisites

None.

Safe intermediate state

Documentation only, unless the decision requires an oracle change.

Acceptance

  • The specification states whether a loop's list must be homogeneous, and the disposition of a loop whose rounds differ in type: refused at admission where evident, and otherwise a violation, a failure or a permitted heterogeneous list.
  • A rule record names the evidence, or the owed witness.

1. Context

Section 2.1 says "$\mathsf{List}(\tau)$ is the value of a loop without a fold" (line 403 at 6026fdae; line 107 at 83f1f889), so a list has one element type. Rule 5 of Section 2.2 checks the operands of arithmetic, conditions, written values, key names and call arguments (line 133 at 83f1f889). It does not check that every round of a loop yields the same type. Table 4a's row "Join of a loop without a fold" (line 251 at 83f1f889) builds the list $[v_0, \ldots, v_{n-1}]$ with no type condition. So the first profile admits a two-round loop whose body is if i = 0 then 1 else true and produces [U64 1, Bool true], which is not a $\mathsf{List}(\tau)$. The reference oracle builds the list with no kind check (crates/ambyte-oracle/src/evaluator/mod.rs, the join.collect branch of fire). The independent review of flyingrobots/amblicit#392 found the typed-atom form of this gap; P1 closes it for the new kinds only, and this issue holds the inherited first-profile case.

2b. Options and consequences

  • (a) Homogeneous lists: refuse an evident mismatch at admission, and make a run-time mismatch a violation when the join settles, as P1 does for the new kinds. Keeps $\mathsf{List}(\tau)$ as written.
  • (b) Heterogeneous lists: change Section 2.1's value domain to permit them. Appendix A already encodes a sequence of values of any kind; the type system changes.

2d. Who decides

flyingrobots (owner), or the council under the owner's delegation. Option (b) changes a first-profile type and needs the owner.

2f. Reversible

Yes; documentation.

7. Related Issues

flyingrobots/amblicit#386, flyingrobots/amblicit#392.

Dominant language
Rust
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flyingrobots/edict

All issues in flyingrobots/edict

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.