Map

Imports
import Maybe;
Table of Contents

Types

Map

(type)
type Map k v

Functions

new

Creates a new empty map.
def new : {m : (Map k v) | Map.size m = 0}

set

Sets the value for a key in the map.
def set (m : (Map k v)) (key : k) (value : v) : (Map k v)

get

Gets the value for a key in the map.
def get (m : (Map k v)) (key : k) : (Maybe v)

get_or

Gets a value with an explicit fallback of the same type.
def get_or (m : (Map k v)) (key : k) (default : v) : v

has

Checks if the map contains a key.
def has (m : (Map k v)) (key : k) : Bool

delete

Removes a key from the map.
def delete (m : (Map k v)) (key : k) : (Map k v)

Uninterpreted

Functions declared as def f ... = uninterpreted: only their signature is known to the verifier; they have no body.

size

uninterpreted
Returns the size (number of entries) of the map.
def size : (m : (Map k v)) → Int