[Next] [Up] [Previous] [Contents]
Next: The concatenation operator
Up: SMV language overview
Previous: Comprehension expressions
A vector is a fixed-length string of values. It differs
from an array in several respects:
- The elements of a vector are not indexed, hence vectors
cannot be subscripted.
- Vectors may be concatenated.
- Arithmetic and comparison operators have special meanings when
applied to vectors (they interpret the vectors as unsigned binary numbers).
- Logical operators have special meanings when applied to vectors
(they perform ``bitwise'' operations).
A vector x of n elements is denoted by a non-empty,
comma-separated list of elements within square brackets:
[xn, ..., x1, x0]
The nth element can be extracted from a vector by the function nth,
which takes a vector as its first argument, and an integer as its second
argument. The function nth numbers the elements of the vector from
zero on the right. So, for example,
nth([5,4,3,2,1,0], 2) = 2
Ken McMillan
Sat Jun 6 21:41:59 PDT 1998