metaborg/dynsem

Tail recursion optimization for indirect recursion

Opened this issue · 0 comments

The first While rule below should be treated as the second While rule by inlining the IfThen rule.

  IfThen(IntV(i), e) --> v
  where
    case i of {
      0 => UnitV() => v
      otherwise => e --> v
    }.
        
  e@While(e1, e2) --> IfThen(e1, e). 
 
  e@While(e1, e2) --> v
  where e1 --> IntV(i);
    case i of {
      0 => 
        UnitV() => v
      otherwise => 
        e2 --> _; e --> v
    }.