Downloader
Types
Functions
def new_downloader (_ : Unit) : {d : Downloader | created d = true && downloading d = false && completed d = false && progress d = 0}
def start (1 d : Downloader | created d = true && progress d = 0) : {out : Downloader | created out = false && downloading out = true && completed out = false && progress out = 0}
def update (1 d : Downloader | downloading d = true) (p : Int | p > progress d && p ≤ 100) : {out : Downloader | downloading out = true && completed out = false && progress out = p}
def finish (1 d : Downloader | downloading d = true && progress d = 100) : {out : Downloader | downloading out = false && completed out = true && progress out = 100}
def discard (1 d : Downloader | completed d = true) : Unit
Uninterpreted
Functions declared as def f ... = uninterpreted: only their signature is known to the verifier; they have no body.
def created : (d : Downloader) → Bool
def downloading : (d : Downloader) → Bool
def completed : (d : Downloader) → Bool
def progress : (d : Downloader) → Int