[MLton] What are the semantics for Word_addCheck?

Matthew Fluet fluet@cs.cornell.edu
Thu, 8 Jun 2006 10:05:23 -0400 (EDT)


>>> Basically, we've finished a CPS transform, and we're now trying to interpret
>>> them in order to ensure that the transform was correct (before we start running
>>> things like Delta CFA and Gamma CFA on them).  Most of the interpreter is
>>> written except for the Prim Ops, and we're trying to figure out what those do
>>> and how they work.
>>
>> Could you explain a little more what you are doing?  You are writing an
>> interpreter for the SXML intermediate language?  That seems like quite a
>> bit of work.  Can't you just continue compiling the CPS transformed
>> program?
>
> We're writing a little interpreter to test the implementation of the CPS
> language.  Also, the CFAs we're planning on writing proceed in a very similar
> manner to the interpreter, so it'll actually be a useful starting point for
> those.  We are not trying to write a fully feature interpreter for either CPS or
> SXML, merely something that can appropriately follow the control flow paths.

Certainly for the CFAs, I can see that you would want an 'abstract 
interpreter'; good to hear that you aren't attempting to write a fully 
featured 'concrete interpreter'.  I guess I was a little bit fuzzy on the 
degree to which you can 'test the CPS language' short of a full concrete 
interpreter.

> Thanks for the description of the Primitives, it'll be vastly useful as we run
> across ones that we haven't implemented yet!

I should have also mentioned that it will probably be helpful to look at 
mlton/atoms/prim.{sig,fun}, particularly at the definitions of the 
functions 'isFunctional', 'mayOverflow', 'mayRaise', 'maySideEffect', and 
'apply'.  The 'is*' and 'may*' functions should help you broadly classify 
the primitives; a vanilla CFA can mostly ignore the 'isFunctional' 
primitives.