Skip to content

Pancake Named Shapes#1393

Merged
tanyongkiam merged 50 commits into
CakeML:masterfrom
talsewell:pan_shape_merge3
May 21, 2026
Merged

Pancake Named Shapes#1393
tanyongkiam merged 50 commits into
CakeML:masterfrom
talsewell:pan_shape_merge3

Conversation

@talsewell
Copy link
Copy Markdown
Contributor

Add the "named shapes" feature to pancake, as implemented by @halogentlepersuasion and subsequently verified by @talsewell .

This permits structs (values of compound shape) to have fields named "x", "y", "head", "tail" etc as opposed to just 0, 1, 2, 3.

The verification and translation is believed to be complete.

Halogen Truong and others added 30 commits November 10, 2025 22:58
…to pan_to_word and pan_passes (+ minor shape related pan_passes improvements)
Add a switch that controls the "safety" of the pancake named-structs features.
The idea is to get to the point where the main proofs are repaired, and the
named-structs features are installed but aren't considered safe for verified
code.

Repair panSem and panProps proofs for the additional types and ops. The fact
that the safety switch is set to off hasn't actually been used yet.
Repair pan_globals and pan_to_crep, that was painful, and bring in the (mostly
stubbed out) "verification" of the pan_structs pass. Committing prior to
refactoring some things for pan_to_word.
The pan_to_target proof *finally* passes after minimising changes to
the preconditions of the various semantics theorems.
It seems not that much additional effort to just verify the pan-structs pass.

OK, some of the issues about using a sub-shape-construct (dropWhile etc) were
fiddly, but the verification is now handling "eval", except for the part about
deducing the shape of an expression.
talsewell added 20 commits May 6, 2026 19:25
Proof is now completed. There was some confusion about the compiler but it
turns out it doesn't need to change. There was one new surprise: the exception
shapes (eshapes) need to be modified. Unclear if that will matter.
A whole bunch of work to purge some approaches to the drop-struct-context
issue. Also retire the separate code_rel with a little fixing in a couple of
places.
This workaround should no longer be needed.
Verification now passes up to pan_to_target. Slight fallout in pan_to_word
caused by the fact that pan_structs now needs to adjust the input state
(replacing the exception-shapes with compiled variants).
Lots of merge conflicts between pancake static maintenance and strlit updates.
That merge created a lot of merge conflicts. They were resolved in favour of
the local (pancake) changes, so some strlits will need to be removed again.
Some errors were also introduced, which should now be fixed.
Looks like a merge issue spliced the syntax around, but it's not clear why or
what it was merging with.
Still to do: from_pancakeXProgScripts.
The cheats are now fixed. The complicated conv_Exp issue (which derailed me for
multiple days) is fixed by using the OPT_MMAP rewrite hack. This is simple
enough for the user but probably means that the generated compiler will build
an unnecessary intermediate list at runtime. Replicating the old fix
(elaborating the conversion to have more mutual recursion) seemed to cause the
translator (specifically translate_no_ind) to diverge. This may be a mistake in
the way I set it up, others are welcome to investigate.
Merging with ac654a0, a recent successful CakeML regression test.
Conflict fix looks suspicious, to be checked.
@tanyongkiam tanyongkiam merged commit 7ed0687 into CakeML:master May 21, 2026
1 check passed
@talsewell
Copy link
Copy Markdown
Contributor Author

Hurrah!

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.

3 participants