CakeML / pure

A verified compiler for a lazy functional language
Other
32 stars 4 forks source link

Remove `apply_closure` from semantics #56

Open hrutvik opened 1 year ago

hrutvik commented 1 year ago

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.