Closed gmalecha closed 5 years ago
I quickly drafted a very naïve scheme by simply assuming a reserved prefix "local". I think it should do the trick but I'll have to double check.
I removed errors from Imp. They were only used in the C-like evaluator assuming partial maps for the environment. I kept the Imp-like total maps for simplicity. If you feel that it's an oversimplification, we can roll back. I kept the heap for now, although the compiler currently allocate everything in the stack. Do we want to be fancier?
I cannot express the theorem right now, I need to parameterize the denotation of Imp rather than fix its effects as is right now.
N.B. : TODO: switch the domain of value from Nat to Z to be able to write factorial and odd/even.
- I quickly drafted a very naïve scheme by simply assuming a reserved prefix "local". I think it should do the trick but I'll have to double check.
This should be fine.
- I removed errors from Imp. They were only used in the C-like evaluator assuming partial maps for the environment. I kept the Imp-like total maps for simplicity. If you feel that it's an oversimplification, we can roll back.
Partial maps might be better in both cases but we can have the effect actually raise the error so that errors don't show up in the implementation.
I kept the heap for now, although the compiler currently allocate everything in the stack. Do we want to be fancier?
Either way. Dropping it or keeping it, as long as it is consistent shouldn't matter. Ultimately, it would be nice to have a language with a heap.
- I cannot express the theorem right now, I need to parameterize the denotation of Imp rather than fix its effects as is right now.
The other option is to give an effect transformer from ImpEff
into a parameterized effect. For example,
Definition to_param {E} {Estate : StateE ~> E} {... } : ImpEff ~> E :=
fun _ e => match e with ... end.
N.B. : TODO: switch the domain of value from Nat to Z to be able to write factorial and odd/even.
Note that switching the representation of programs in Asm to the old definition of CR required to split their denotation in two, first to denote the program and then the main itself, since the latter is now a block and no longer a label.
:+1: @YaZko
Hey, I'm wondering how we want to organize the new material. We have:
sum.v
that should clearly migrate to the library;Asm
specific stuff: the syntax and denotation of blocks that lives in Asm.v;Imp2Asm.v
at the moment.
But then things get a bit less clear in my mind.
Imp2AsmBis.v
, that should be renamed, strives to be a generic theory of linking. So it should morally be a functor parameterized by a type block
and a function denote_b
and some good properties on this denotation.
However, both this theory and Asm's semantics depend on definitions like den
and all its combinators, while we would like to define them independently from one another.
So I guess the conclusion is that we should pull out another theory which is essentially the diagrammatic one that @Lysxia wrote this morning. If so, how should we name this entity?This looks great.
What is going on with CI?
Fails to build Basics_Functions
, but I can't reproduce.
The build of paco reports lots of warnings about hints being implicitly added to core
, but I can't seem to trigger the warning even intentionally. Those warnings do not appear on paco's CI. https://travis-ci.org/snu-sf/paco
Travis is not building coq 8.8 and 8.9 but the master branch of coq on github in both cases...
This is a huge PR!
Is the plan to hold this until the deadline?
that sounds like a good plan!
Yannick and I wrote this compiler together. Yannick is working on cleaning up some of the definitions and we'll verify it. There are a few things left to do:
Some possible extensions:
break
,continue
, etc.This isn't ready to merge yet