Functions Chapter 10 Formal Specification using Z A function is a relation In a programming language a function is a way of specifying some processing which produces a value…