svenkeidel / sturdy

Sturdy is a library for developing sound static analyses in Haskell.
BSD 3-Clause "New" or "Revised" License
60 stars 5 forks source link

The implementation of While loops can be shared code. #19

Closed svenkeidel closed 6 years ago

svenkeidel commented 6 years ago

Currently the implementation of while loops is implemented as operation, rather than shared code: https://github.com/MDBijman/sturdy/blob/lambdajs/lambdajs/src/SharedConcrete.hs#L357-L361

However, you can implement while loops in the shared interpreter by desugaring them to conditionals: https://github.com/svenkeidel/sturdy/blob/master/while/src/SharedSemantics.hs#L87-L88

The benefit of this is that we have one operation less to worry about when we want to prove soundness.