%!TEX root = report.tex
%
\chapter{Types}
\label{chap:types}
The grammar of Diderot types is as follows:
\begin{Grammar}
\TypeRULES{}
\end{Grammar}%
\section{Value types}
Diderot supports four types of concrete values: booleans, integers, strings, and tensors.
The grammar of these types is
\begin{Grammar}
\ValueTypeRULES{}
\DimensionsRULES{}
\end{Grammar}%
The tensor type \mbox{\kw{tensor}\kw{[}$d_1,\ldots{},d_n$\kw{]}} is the of type order-$n$ tensors
with shape $d_1,\ldots{},d_n$.
Tensors include scalars (order-0) and vectors (order-1).
Because these types are frequently used, Diderot supports the following predefined type definitions:
\begin{center}
\begin{tabular}{r@{$\quad\equiv\quad$}l}
\kw{real} & \texttt{\kw{tensor}\kw{[}\kw{]}} \\
\kw{vec2} & \texttt{\kw{tensor}\kw{[}2\kw{]}} \\
\kw{vec3} & \texttt{\kw{tensor}\kw{[}3\kw{]}} \\
\kw{vec4} & \texttt{\kw{tensor}\kw{[}4\kw{]}}
\end{tabular}
\end{center}%
\section{Images}
\section{Fields}
\section{Kernels}
Kernels are abstract types that represent the \emph{convolution kernels} used
to reconstruct continuous fields from image data.
The syntax of a kernel type is \mbox{\kw{kernel}\kw{\#}$k$}, where
$k \geq 0$ gives the number of levels of differentiation supported by the
kernel.