Changes between Version 23 and Version 24 of NestedCPR


Ignore:
Timestamp:
Jan 9, 2014 4:54:47 PM (14 months ago)
Author:
nomeata
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NestedCPR

    v23 v24  
    8484 * It is important that functions (including primitive operations and constructors like `I#`) have a strict demand on their unlifted argument. But it turned out to be easier to enforce this in the demand analyser: So even if `f` claims to have a lazy demand on a argument of unlifted type, we make this demand strict before feeding it into the argument. 
    8585 
     86Unfortunate example: 
     87{{{ 
     88g :: Int -> (Int,Int) 
     89g 1 = (0,0) 
     90g x = (x,0) 
     91}}} 
     92What should its signature be? We want `<S>t`, but we get `<S>`. Why? Because the branches have signatures `t` and `{x ↦ S} t`. So their lub is going to be `{x ↦ L}`. In a later step, the demand on `x` will be strict again, but that is not easily visible here. 
     93 
     94Can we avoid this? Not if we want to keep using the strictness demand as the hypothesis for the termination information. The alternative would be to to track the demand required separately from strictness. Then the lub of `t` and `{x ↦ required} t` would be `{x ↦ required} t`, and this case would work fine. That would turn it into a completely separate analysis, it seems. 
     95 
    8696=== join points === 
    8797