WhileyCompiler icon indicating copy to clipboard operation
WhileyCompiler copied to clipboard

Flow Typing and Loop Invariants

Open DavePearce opened this issue 5 years ago • 0 comments

The following fails because of flow typing:

function create(nat size, nat value) -> nat[]:
    int[] r = [0; size]
    nat i = 0
    while i < |r| where r is nat[]:
        r[i] = value
        i = i + 1
    return r

DavePearce avatar Mar 18 '20 23:03 DavePearce