TLA + "Specifying Systems" draft translation --Section 6.5 Using Functions (function uses)

This section points
defined function with the best f = [ i N a t i + 1 ] f'=[i \in Nat \mapsto i+1] In this way

Consider the following two formulas:
(6.6) f = [ i N a t i + 1 ] f'=[i \in Nat \mapsto i+1]
(6.7) i N a t : f [ i ] = i + 1 \forall i \in Nat: f'[i]=i+1
both for each of a number of natural i i , have f [ i ] = i + 1 f'[i]=i+1 , but they are not equivalent. Formula (6.6) uniquely determine f f' , It declares it is a domain of N a t Nat function, but the formula (6.7), there are many different f f' Satisfies the condition, for example the following functions: [ i R e a l IF  i N a t  THEN  i + 1  ELSE  i 2 ] [i \in Real \mapsto \text{IF } i \in Nat \text{ THEN } i + 1 \text{ ELSE } i^2] In fact, from the formula (6.7), we can not even deduce f f' Is a function. Equation (6.6) contains the formula (6.7), not vice versa.
When writing the statute, we generally like to variables f f simple assignment once on the line, not all elements of the collection i i Ode again f [ i ] f[i] values. Therefore, we usually recommend to write formula (6.6) instead of (6.7).

Released four original articles · won praise 1 · views 5526

Guess you like

Origin blog.csdn.net/robinhzp/article/details/103564330