[plt-dev] Multi-color calculi in Redex

From: Christos Dimoulas (chrdimo at ccs.neu.edu)
Date: Thu May 14 12:14:31 EDT 2009

Robby Findler wrote:
> Am I right that you want to define a parameterize grammar (where you
> are counting the let nesting depth)?
>   
  Not exactly, I am trying to paint the evaluation context with the 
color i of the deepest colored frame {E_0}_i

> You can't do that like that; instead just define E that has all lets
> in it, and when you wanted E_i for some i, write a metafunction that
> counts the depth of the E and use a side-condition to ensure that the
> size is i.
>   
  Your suggestion may work in this case too. I will try to right a 
metafunction that returns the color of the evaluation context
   instead of having the grammar keep track of it.
 
  Thanks.
 
  .Christos

> hth,
> Robby
>
> On Thu, May 14, 2009 at 11:03 AM, Christos Dimoulas <chrdimo at ccs.neu.edu> wrote:
>   
>> I would like to define the following grammar in Redex:
>>
>> e := .... | let x = e in e | {e}_i
>> E_0 := [] | let x=E_0 in e
>>
>> E_i := let x = E_i in e | {E_0}_i | {E_i}_j
>>
>> where i,j in N^*.
>>
>> Do you have any ideas how I could code that in Redex?
>>
>> Thank you.
>>
>> .Christos
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-dev
>>
>>     



Posted on the dev mailing list.