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