next up previous contents
Next: The concatenation operator Up: The SMV language Previous: Comprehension expressions   Contents

Vectors and vector operators

A vector is a fixed-length sequence of values. Various operations are allowed on vectors, including concatenation, test for equality, and binary arithmetic and logical operators, which treat a vector as a binary number. Note, however, that a vector itself is not a ``first class'' value in SMV. That is, it is not possible for the value of a signal to be a vector. However, syntactic shorthands are provided that make it possible to treat vectors as if they were first class values.

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



Subsections

2002-10-28