Skip to content

Switch to more efficient sexp datatype#1365

Open
myreen wants to merge 4 commits intomasterfrom
sexp-switch
Open

Switch to more efficient sexp datatype#1365
myreen wants to merge 4 commits intomasterfrom
sexp-switch

Conversation

@myreen
Copy link
Copy Markdown
Contributor

@myreen myreen commented Mar 25, 2026

No description provided.

tanyongkiam and others added 4 commits February 20, 2026 01:08
Rewrite compiler/parsing/fromSexpScript.sml to use mlsexp (Atom/Expr)
from basis/pure instead of simpleSexp from HOL4's context-free examples.
This is Phase 1 of eliminating simpleSexp from CakeML.

Key changes:
- Ancestor: mlsexp replaces simpleSexpParse
- Holmakefile: INCLUDES basis/pure instead of HOL4 context-free
- Encoding: SX_SYM/SX_NUM/SX_STR/SX_CONS replaced by Atom/Expr
- listsexp xs = Expr xs (trivial, lists are native)
- dstrip_sexp extracts tag + args from Expr (Atom tag :: args)
- All roundtrip proofs (encoder/decoder bijection) updated
- dstrip_sexp_SOME uses strlit nm form for efficient gvs resolution

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Use mlsexp$fromString instead of parse_sexp for sexp input parsing,
and sexp_to_string instead of print_sexp for sexp output. Remove
simpleSexpParse ancestor and formal-languages/context-free includes
from compiler, scheme, and dafny Holmakefiles.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…n files

SexpProg (in basis/) already translates the mlsexp parser/printer to CakeML,
so the translation files no longer need to translate simpleSexp's PEG parser,
printer, or destructor functions. Remove ~300 lines of now-unnecessary code.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@dnezam dnezam added the test failing regression test failed on the latest commit of this pull request label Mar 26, 2026
@dnezam
Copy link
Copy Markdown
Contributor

dnezam commented Mar 26, 2026

In addition to the proof failure in sexp_parserProg, it also swapped out Unicode double quotes with string quotes in dafny_compilerProg

@tanyongkiam
Copy link
Copy Markdown
Contributor

the sexp_parser failure is known, I just didn't want to fix it manually yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test failing regression test failed on the latest commit of this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants