Error Detection

Imagine a simple library system. An abstract specification for this system may introduce datatypes User, Book and Library. A function LendBook specifies the user transaction of borrowing a book from the library. The number of books which can be borrowed by a single user is restricted to a certain limit modeled by a constant BorrowingLimit. A predicate Authorized characterizes whether a user is allowed to borrow a book or not (e.g. the system distinguish between different user classes).