I guess I should define the terms first:
- small letters denote variable name, capital letters denote terms (exceptions below).
-
$T$ denotes a type name. -
$\mathbf{V}$ denotes the set of all variable names. -
$\mathbf{F}$ denotes the set of all function names. -
$\mathbf{K}$ denotes the set of all constants. - term definition:
- if
$x \in \mathbf{V} \cup \mathbf{K}$ then$x$ is a term. - if
$f \in \mathbf{F}$ , and$A$ and$B$ are terms, then so is$f(A, B)$ .
- if
- the functions have type signature
$(T_1, T_2) \mapsto T_3$ . -
$\mathbf{T}$ denotes any type i.e., type names as well as function types. -
$A: \mathbf{T}$ means that$A$ is of type$\mathbf{T}$ . -
$\Gamma$ denotes a set$X_0 := Y_0, X_1 := Y_1, \ldots, X_n := Y_n$ of axioms (defined using theaxiom
keyword). -
$\Pi$ denotes a set$X_1: \mathbf{T}_1, X_2: \mathbf{T}_2, \ldots, X_n: \mathbf{T}_n$ of type assignments (defined using thetype
keyword). - in
$A[x/Y]$ ,$x/Y$ denotes a pattern/replacement pair, where$x$ is a variable, while$Y$ is a term. - the substitution algorithm
$A[x/Y]$ is defined as follows:-
${\displaystyle {x[x/Y] = Y}}$ . -
${\displaystyle {a[x/Y] = a, a \in \mathbf{V} - \set{x}}}$ . -
${\displaystyle {k[x/Y] = k, k \in \mathbf{K}}}$ . -
${\displaystyle {f(A, B)[x/Y] = f(A[x/Y], B[x/Y])}}$ .
-
The heart of nnoq is a single operator, :=
, which is governed by the following axioms:
1.
2.
3.
4.
5.
the following five axioms are for the type analysis (inference and checking):
6.
7. :=
#1)
8. :=
#2)
9.
10.
nnoq builds on top of this foundation by generalizing the functions to arbitrary arity. however, this does not increase its power, as an n-arity function