Inference operator
The,==> symbol in VCC means the result of logical inference, that is, the implication relation in discrete mathematics. P==>q is equivalent to ((! P) | | (Q)). is a very commonly used operator.
Quantifier (quantifier)
As for quantifiers, this refers to the universal quantifier (Universal quantifier) and the existence quantifier (existential quantifier).
The description method of the universal quantifier in VCC is \forall T v; E, meaning "for any V of type T, the expression E is true."
For example:
_ (Assert x > 1 && \forall int i; 1 < i && i < x ==> x% i! = 0)
Assertion Test X is a prime number.
_ (Assert \forall int i; \forall int J; 0 <= i && i <= J && J < N ==> B[i] <= b[j])
Asserts that array B is ordered.
Similarly, the presence of quantifiers in VCC is expressed in \exists T v; E, meaning "V exists in the type T, so that expression E is set".
For example:
_ (Assert \exists int i; 0 <= i && i < N && B[i] = = 0)
Asserts that array B contains element 0.
Mapping (MAP)
VCC provides a mapping type, which is used a bit like an array, but their value is not necessarily a simple number or character, he is a mapping between two types of data. such as \integer x [int] is a mapping from the int type to the \integer type, x[-5] is the \integer value corresponding to 5 in X, but no one knows which \integer the 5 maps to because no mapping is given.
Note: \integer represents an integer in mathematical sense, while \natural is a natural number
For the creation of mappings, a lambda expression is generally used. such as \lambda T x; E, the expression will return a map from the x map of type T to the result after "x is computed by Expression E", and if the expression e evaluates to the type S, then the type of the mapping is s[t].
Cases:
_ (ghost int av[\natural] = \lambda \natural i;buf[i])
Ignore the previous ghost, and later, the following expression will create an AV map, from the natural number to the int type, mapped to Buf[i].
<VCC notes > Inference operators, Mappings and quantifiers