Arithmetic
Naturals
The most basic type of number in Vehicle are the natural numbers.
The type of natural numbers is written as Nat.
The available operations over naturals are:
Operation |
Syntax |
Type |
Support |
|---|---|---|---|
Add |
|
|
|
Multiply |
|
|
|
Divide |
|
|
|
Compare |
x < yx > yx <= yx >= yx == yx != y |
|
Note that inequalities can be chained, so that x < y <= z will be
expanded to x < y and y <= z.
Reals
The type of real numbers is written as Real.
The available operations over reals are:
Operation |
Syntax |
Type |
Support |
|---|---|---|---|
Add |
|
|
|
Subtract |
|
|
|
Multiply |
|
|
|
Divide |
|
|
|
Negation |
|
|
|
Compare |
x < yx > yx <= yx >= yx == yx != y |
|
|
Min |
|
|
|
Max |
|
|
|
Infinity |
|
|
Note
We are aware that the disconnect between the semantics of real numbers and floating point can lead to soundness bugs in verification. Adding floating point types with configurable precision is on our road map.