invariant

fun <ID, V : Value<ID, V, S>, S : State<ID, V, S>> invariant(message: String, predicate: (V) -> Boolean): Invariant<ID, V, S>

Creates an invariant that checks if the given predicate holds true for the value.