Type checking a specification
Type-checking determines whether a specification makes sense mathematically, independent of what networks, datasets and parameters it will be used with.
- This includes:
that operations are applied to the right types of data (e.g. that it doesn’t add a
Vectorto aBool).that variables are used consistently (e.g. the same variable
xisn’t used as anNatin one place and as aTensorin another).that there are no out-of-bounds errors when indexing into
VectorandTensor(e.g. ifxsis a vector of size 2 then we don’t use index into it at any position other than0and1).
Note most other Vehicle commands will type-check the specification automatically.
Command-line interface
A specification can be type-checked on the command-line using the
vehicle check mode.
vehicle check \
--specification my/project/specification.vcl
The table below contains the full list of possible arguments:
- --specification, -s
The
.vclfile containing the specification.
- --typeSystem, -t
Optional. The type-system to use when checking the specification. 99% of the time you should not provide a value for this option as the default value
Standardis what you want. However there are further options which means are used by Vehicle to work out the linearity, polarity and decidability of specifications (see this paper for details). -Standard-Linearity-Polarity-Decidability