Stack
Types
Functions
def new_stack (_ : Unit) : {s : (Stack a) | stack_size s = 0}
def push (1 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 (1 p : (StackPop a)) : a
def pop_stack (1 p : (StackPop a)) : {s : (Stack a) | stack_size s = pop_size p}
def peek (_inst5626 : (Copy a)) (borrow s : (Stack a) | stack_size s > 0) : a
def discard (1 s : (Stack a) | stack_size s = 0) : Unit
def with_pop (_inst5627 : (Copy a)) (1 token : (StackPop a)) (1 consume : (value : a) → (1 handle : (Stack a) | stack_size handle = pop_size token) → b) : b
def with_pop_owned (1 token : (StackPop a)) (1 consume : (1 value : a) → (1 handle : (Stack a) | stack_size handle = pop_size token) → b) : b
def length (borrow s : (Stack a)) : {n : Int | n = stack_size s && n ≥ 0}
def empty (borrow s : (Stack a)) : {b : Bool | b = (stack_size s = 0)}
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