Stack
Types
Functions
def new_stack (_ : Unit) : {s : Stack a | stack_size s = 0}
def push (x : a) (1 s : Stack a) : {out : Stack a | stack_size out = stack_size s + 1}
def pop (1 s : Stack a | stack_size s > 0) : {p : StackPop a | pop_size p = stack_size s - 1}
def pop_value (p : StackPop a) : a
def pop_stack (p : StackPop a) : {s : Stack a | stack_size s = pop_size p}
def peek (1 s : Stack a | stack_size s > 0) : {p : StackPeek a | peek_size p = stack_size s}
def peek_value (p : StackPeek a) : a
def peek_stack (p : StackPeek a) : {s : Stack a | stack_size s = peek_size p}
def len_of (1 s : Stack a) : {l : StackLen a | held_size l = stack_size s}
def len_value (l : StackLen a) : {n : Int | n = held_size l && n ≥ 0}
def len_stack (l : StackLen a) : {s : Stack a | stack_size s = held_size l}
def discard (1 s : Stack a | stack_size s = 0) : Unit
Uninterpreted
Functions declared as def f ... = uninterpreted: only their signature is known to the verifier; they have no body.
def stack_size : (s : Stack a) → Int
def pop_size : (p : StackPop a) → Int
def peek_size : (p : StackPeek a) → Int
def held_size : (l : StackLen a) → Int