Skip to content

Improving forward generation by "inlining" -- experiments and design doc - #58

Open
mwhicks1 wants to merge 3 commits into
mainfrom
pr-inlining-1-design
Open

Improving forward generation by "inlining" -- experiments and design doc#58
mwhicks1 wants to merge 3 commits into
mainfrom
pr-inlining-1-design

Conversation

@mwhicks1

Copy link
Copy Markdown
Contributor

Consider a state-transition specification — a step relation whose constructors are the labeled edges of a state machine, plus a trace relation that chains steps:

Step  : State → Cmd → Result → State → Prop
Trace : State → List (Cmd × Result) → State → Prop

Suppose we ask Specimen to derive a forward generator for Trace: from a start state it walks the machine, at each step picking an enabled edge, which it adds to the trace. Unfortunately, when a Cmd has a precondition that isn't cheaply satisfiable, the forward generator often fails to exercise that command. This PR includes a pair of design documents about ways to fix this problem, backed up by experiments also committed. A key insight is that in Step we might want to "inline" multiple steps into a single branch, so that a generation decision in one Cmd can be influenced by a precondition on a downstream Cmd. Follow-on PRs explore implementation of this design.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

mwhicks1 added 3 commits July 22, 2026 15:40
Adds the design write-up (Docs/Lookahead-experiment.md) for generating command
sequences with hard-to-satisfy preconditions via adjacent-step inlining, plus a
companion note on steering (Docs/Steering-notes.md) and an appendix explaining
why the state-machine/path-planning framing is the wrong one (control and data
cannot be separated).

Includes the hand-written experiments the design is based on:
  * perfect-square ticket vault (flat Step/Trace): baseline, fused pair,
    all-combinations;
  * guarded-dereference (self-recursive typing relation over a tree): baseline,
    fused, all-combinations (inlining across the typing relation and the
    membership relation it calls).

No changes to Specimen itself; experiments are self-contained and build.
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.

1 participant