CakeML / CakeML/pure

Remove `apply_closure` from semantics

Open
#56 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Standard ML
Stars
44
Forks
5
PR merge metrics
No merged PRs in 30d

Description

PureLang, ThunkLang, and EnvLang all use a function called `apply_closure` in their semantics. With the changes from #31, this seems unnecessary - `apply_closure` should instead be replaced by straightforward function application. This should simplify various proofs, particularly in ThunkLang where removing lemmas concerning `apply_closure` will likely streamline things.

Care needs to be taken for `Ret`/`Raise` in ThunkLang/EnvLang - these are now call-by-value, i.e. they evaluate the contained argument no matter what. This is achieved by a combination of `with_value`/`apply_closure` currently.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the PureLang, ThunkLang, and EnvLang semantics and the changes from #31. Trace each use of apply_closure and the related with_value handling, paying particular attention to call-by-value Ret and Raise in ThunkLang and EnvLang. Done means direct function application replaces apply_closure and the affected proofs, especially in ThunkLang, no longer need its lemmas.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.