# A new goodness of fit test for normal distribution based on Stein’s
characterization

Sudheesh K Kattumannil†
Indian Statistical Institute, Chennai, India

###### Abstract.

We develop a new non-parametric test for testing normal distribution using
Stein’s characterization. We study asymptotic properties of the test
statistic. We also develop jackknife empirical likelihood ratio test for
testing normality. Using Monte Carlo simulation study, we evaluate the finite
sample performance of the proposed JEL based test. Finally, we illustrate our
test procedure using two real data.
Key words:  Empirical likelihood; Stein’s identity; U-statistics;.

†Author e-mail<EMAIL_ADDRESS>
##  1\. Introduction

Test for normal distribution has great significance as most of the classical
tests are developed on the assumption that the available data are generated
from normal distribution. For goodness of fit test associated with normal
distribution using different approaches we refer interested readers to Thode
(2002), Zamanzade and Arghami (2012), Bera et al. (2016), Henze and Koch
(2017), Nikitin (2018), Sulewski (2019) and Betsch and Ebner (2019a) and the
references therein. Among these Betsch and Ebner (2019a) developed a test for
normal distribution based on the distance between empirical zero-bias
transformation and empirical distribution (Betsch and Ebner, 2020). Their test
statistic has complicated expression which leads to the implementation of the
test difficult. Motivated by Betsch and Ebner (2019a) we develop a simple non-
parametric test for testing normal distribution based on Stein’s
characterization.

Stein’s identity for normal distribution and its applications has been well
studied in statistical literature. Let $X$ be a continuous random variable
with finite mean $\mu$ and variance $\sigma^{2}$. Let $c(x)$ be a continuous
function having first derivative. Then $X$ has normal distribution with mean
$\mu$ and variance $\sigma^{2}$ if and only if

$E(c(X)(X-\mu))=\sigma^{2}E(c^{\prime}(X)),$

provided the above expectations exist and the prime denotes the derivative
with respect to $x$. Stein’s type identity for general class of probability
distributions and related characterizations, we refer interested readers to
Sudheesh (2009) and Sudheesh and Dewan (2016) and the references therein. Ross
(2011) discussed approximation of the normal, Poisson, exponential and
geometric distributions using Stein’s method. Using Stein’s characterization
of normal random variable, we develop a new goodness of fit test for normal
distribution.

The rest of the article is organized as follows. In Section 2, based on
Stein’s characterization we develop new non-parametric test for testing
normality. We develop our test using the theory of U-statistics. We study
asymptotic properties of the proposed test statistic. We also develop a
jackknife empirical likelihood (JEL) ratio test for testing normality. A Monte
Carlo simulation study is carried out to asses the finite sample performance
of the JEL ratio test and the result is reported in Section 3. We compare the
power of our test with that of Anderson-Darling and Jarque-Berra tests which
shows the competitiveness of our test with these classical tests. We also give
the illustration of our test procedure using two real data sets. Concluding
remarks along with some open problems are given in Section 4.

##  2\. Test statistics

Let $X$ be a continuous random variable with distribution function $F(.)$.
Assume that the mean $\mu=E(X)$ is finite. Define

$e_{X}(x)=E(X(X-x)I(X\leq x)),$

where $I$ denotes the indicator function. We use the following
characterization to develop a goodness of fit test for normal distribution.

######  Theorem 1.

(Betsch and Ebner, 2019a). A continuous random variable $X$ with distribution
function $F$, $\mu=0$ and variance $\sigma^{2}=1$ has the standard normal
distribution if and only if $F(x)=e_{X}(x),\,\forall x\in R.$

###  2.1. U-statistics based test

Based on a random sample $X_{1},...,X_{n}$ from $F$, we are interested in
testing the null hypothesis

$H_{0}:F\in\\{N(\mu,\sigma^{2});(\mu,\sigma^{2})\in\mathbb{R}\times(0,\infty)\\}$

against a general alternatives

$H_{0}:F\notin\\{N(\mu,\sigma^{2});(\mu,\sigma^{2})\in\mathbb{R}\times(0,\infty)\\}.$

Due to affine invariance property of the normal distribution, we assume
$\mu=0$ and $\sigma^{2}=1$. When $\mu$ and $\sigma^{2}$ are un-known, we can
implement the test based on the transformation
$Y_{i}=\frac{X_{i}-\bar{X}}{S_{X}}$, $i=1,\ldots,n$, where
$\bar{X}=\frac{1}{n}\sum_{i=1}^{n}X_{i}$ and
$S_{X}^{2}=\frac{1}{n-1}\sum_{i=1}^{n}(X_{i}-\bar{X})^{2}$ are the sample mean
and sample variance, respectively. In Remark 1, we show that our test is
invariant under the transformation $Y_{i}$.

For testing the above hypothesis first we define a departure measure which
discriminate between null and alternative hypothesis. Consider $\Delta(F)$
given by

$\displaystyle\Delta(F)$ $\displaystyle=$
$\displaystyle\int_{-\infty}^{\infty}(e_{X}(x)-F(x))dF(x).$ (1)

In view of Theorem 1, $\Delta(F)$ is zero under $H_{0}$ and not zero under
$H_{1}$. Hence $\Delta(F)$ can be considered as a measure of departure from
the null hypothesis $H_{0}$ towards the alternative hypothesis $H_{1}$.

As our test is based on U-statistics, we express $\Delta(F)$ as an expectation
of the function of random variables. Consider

$\displaystyle\Delta(F)$ $\displaystyle=$
$\displaystyle\int_{-\infty}^{\infty}(e_{X}(x)-F(x))dF(x)$ (2)
$\displaystyle=$ $\displaystyle\int_{-\infty}^{\infty}(E(X(X-x)I(X\leq
x))-F(x))dF(x)$ $\displaystyle=$
$\displaystyle\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}t(t-x)I(t\leq
x)dF(t))dF(x)-\frac{1}{2}$ $\displaystyle=$
$\displaystyle\int_{-\infty}^{\infty}\int_{-\infty}^{x}t(t-x)dF(t)dF(x)-\frac{1}{2}.$

We observed that the probability density function of the random variable
$\min(X_{1},X_{2})$ is $2\bar{F}(x)dF(x),$ where $\bar{F}(x)=1-F(x)$. Hence by
Fubini’s theorem, we have

$\displaystyle\int_{-\infty}^{\infty}\int_{-\infty}^{x}t^{2}dF(t)dF(x)$
$\displaystyle=$
$\displaystyle\int_{-\infty}^{\infty}t^{2}\int_{t}^{\infty}dF(x)dF(t)$ (3)
$\displaystyle=$
$\displaystyle\frac{1}{2}\int_{-\infty}^{\infty}2t^{2}\bar{F}(t)dF(t)$
$\displaystyle=$
$\displaystyle\frac{1}{2}E\big{(}\min(X_{1},X_{2})^{2}\big{)}.$

Also

$\displaystyle\int_{-\infty}^{\infty}\int_{-\infty}^{x}txdF(t)dF(x)$
$\displaystyle=$ $\displaystyle E\big{(}X_{1}X_{2}I(X_{1}<X_{2})\big{)}.$ (4)

Substituting the equations (3) and (4) in equation (2) we obtain

$\displaystyle\Delta(F)$ $\displaystyle=$
$\displaystyle\frac{1}{2}E\big{(}\min(X_{1},X_{2})^{2}-2X_{1}X_{2}I(X_{1}<X_{2})\big{)}-\frac{1}{2}.$
(5) $\displaystyle=$ $\displaystyle\Delta_{1}(F)-\frac{1}{2}.$

Let $h(X_{1},X_{2})$ be a symmetric kernel defined as

$\displaystyle h(X_{1},X_{2})$ $\displaystyle=$
$\displaystyle\frac{1}{4}(2\min(X_{1},X_{2})^{2}-2X_{1}X_{2}I(X_{1}<X_{2})-2X_{1}X_{2}I(X_{2}<X_{1}))$
$\displaystyle=$
$\displaystyle\frac{1}{2}\big{(}\min(X_{1},X_{2})^{2}-X_{1}X_{2}\big{)}.$

A U-statistic given by

$\widehat{\Delta}_{1}=\frac{1}{\binom{n}{2}}\sum_{i=1}^{n}\sum_{j=1,j<i}^{n}h(X_{i},X_{j}),$

is an unbiased estimator of $\Delta_{1}(F)$. Hence the test statistic is

$\displaystyle\widehat{\Delta}$ $\displaystyle=$
$\displaystyle\widehat{\Delta}_{1}-\frac{1}{2}.$

We use the above representation to study the asymptotic properties of the test
statistic. Let $X_{(i)}$, $i=1,\ldots,n$ be the $i$-th order statistics based
on a random sample $X_{1}\ldots,X_{n}$ from $F$. Then $\widehat{\Delta}$ can
be expressed as a simple form

$\displaystyle\widehat{\Delta}$ $\displaystyle=$
$\displaystyle\frac{1}{n(n-1)}\sum_{i=1}^{n}(n-i)X_{(i)}^{2}-\frac{1}{n(n-1)}\sum_{i=1}^{n}\sum_{j=1,j<i}^{n}X_{i}X_{j}-\frac{1}{2}.$
(6)

Test procedure is to reject the null hypothesis $H_{0}$ against the
alternative hypothesis $H_{1}$ for large values of $\widehat{\Delta}$. We find
the critical region of the test using the asymptotic distribution of
$\widehat{\Delta}$.

######  Remark 1.

Suppose $X_{1},...,X_{n}$ are random sample from $N(\mu,\sigma^{2})$. Test
based on the asymptotic distribution of $\widehat{\Delta}$ is invariant under
the transformation $Y_{i}=\frac{X_{i}-\bar{X}}{S_{X}}$, $i=1,2,\ldots,n$.
Hence we construct the test using the transformation
$Y_{i}=\frac{X_{i}-\bar{X}}{S_{X}}$. Under the transformation
$\frac{X_{i}}{S_{X}}$ we obtain the test statistics as
$\widehat{\Delta}/S_{X}^{2}$. Since $S_{X}^{2}$ is a consistent estimator of
$\sigma^{2}$ it is easy to prove that the test is invariant. Next we show that
the test is invariant under location. Let $Z_{i}=X_{i}-\bar{X}$,
$i=1,2,\ldots,n$. Consider

$\displaystyle\widehat{\Delta}_{1}^{*}$ $\displaystyle=$
$\displaystyle\frac{1}{\binom{n}{2}}\sum_{i=1}^{n}\sum_{j=1,j<i}^{n}\frac{1}{2}\big{(}\min(Z_{i},Z_{j})^{2}-Z_{i}Z_{i}\big{)}$
$\displaystyle=$
$\displaystyle\frac{1}{\binom{n}{2}}\sum_{i=1}^{n}\sum_{j=1,j<i}^{n}\frac{1}{2}\big{(}(\min(X_{i},X_{j})-\bar{X})^{2}-(X_{i}-\bar{X})(X_{j}-\bar{X})\big{)}$
$\displaystyle=$
$\displaystyle\frac{1}{\binom{n}{2}}\sum_{i=1}^{n}\sum_{j=1,j<i}^{n}\frac{1}{2}\big{(}\min(X_{i},X_{j})^{2}-X_{i}X_{j}$
$\displaystyle\qquad\qquad\qquad-2\min(X_{i},X_{j})\bar{X}+\bar{X}X_{i}+\bar{X}X_{j}\big{)}$
$\displaystyle=$
$\displaystyle\widehat{\Delta}_{1}+\frac{1}{\binom{n}{2}}\sum_{i=1}^{n}\sum_{j=1,j<i}^{n}\frac{1}{2}\big{(}\bar{X}X_{i}+\bar{X}X_{j}-2\min(X_{i},X_{j})\bar{X}\big{)}$
$\displaystyle=$
$\displaystyle\widehat{\Delta}_{1}+\bar{X}\frac{1}{\binom{n}{2}}\sum_{i=1}^{n}\frac{|X_{1}-X_{2}|}{2}$
$\displaystyle=$ $\displaystyle\widehat{\Delta}_{1}+\bar{X}U_{1},$

where $U_{1}=\frac{1}{\binom{n}{2}}\sum_{i=1}^{n}\frac{|X_{1}-X_{2}|}{2}.$
Since $U_{1}$ is a U-statistic, $\sqrt{n}U_{1}$ is bounded in probability.
Hence

$\displaystyle\sqrt{n}\widehat{\Delta}_{1}^{*}$ $\displaystyle=$
$\displaystyle\sqrt{n}\Delta_{1}+\sqrt{n}\bar{X}\sqrt{n}U_{1}\frac{1}{\sqrt{n}}$
$\displaystyle=$
$\displaystyle\sqrt{n}\widehat{\Delta}_{1}+O_{p}(1).O_{p}(1).o_{p}(1)=\sqrt{n}\widehat{\Delta}_{1}+o_{p}(1).$

Therefor the proposed test is invariant under the transformation $Y_{i}$.

Next we prove the asymptotic properties of the test statistics. As the test
statistic is based on U-statistics next result is immediate (Lehmann, 1951).

######  Theorem 2.

$\widehat{\Delta}$ is a consistent estimator of $\Delta(F)$ under the
alternatives $H_{1}$.

######  Theorem 3.

As $n\rightarrow\infty$, $\sqrt{n}(\widehat{\Delta}-\Delta{(F)})$ converges in
distribution to Gaussian with mean zero and variance $\sigma^{2}$, where
$\sigma^{2}$ is given by

$\sigma^{2}=Var\Big{(}X^{2}\bar{F}(X)+\int_{-\infty}^{X}y^{2}dF(y)-\mu
X\Big{)}.$ (7)

Proof: The asymptotic distributions of $\sqrt{n}(\widehat{\Delta}-\Delta(F))$
and $\sqrt{n}(\widehat{\Delta}_{1}-\Delta_{1}(F))$ are same. Using the central
limit theorem on U-statistics, we have the asymptotic normality of
$\sqrt{n}(\widehat{\Delta}_{1}-\Delta_{1}(F))$ and the asymptotic variance is
$\sigma^{2}=4\sigma_{1}^{2}$, where $\sigma_{1}^{2}$ is given by (Lee, 1990)

$\sigma_{1}^{2}=Var\big{(}E(h(X_{1},X_{2})|X_{1})\big{)}.$ (8)

Now, consider

$\displaystyle E(\min(X_{1},X_{2})^{2}|X_{1}=x)$ $\displaystyle=$
$\displaystyle E(x^{2}I(x<X_{2})+X_{2}^{2}I(X_{2}\leq x))$ (9)
$\displaystyle=$ $\displaystyle x^{2}\bar{F}(x)+\int_{-\infty}^{x}y^{2}dF(y).$

Also

$\displaystyle E(X_{1}X_{2}|X_{1}=x)=x\mu.$ (10)

Substituting the equations (9) and (10) in equation (8) we obtain the variance
expression as specified in equation (7). Hence, we have the proof of the
theorem.
We know that $\Delta{(F)}=0$ under the null hypothesis $H_{0}$. Hence we have
the following corollary.

######  Corollary 1.

Under $H_{0}$, as $n\rightarrow\infty$, $\sqrt{n}\widehat{\Delta}$ converges
in distribution to Gaussian with mean zero and variance $\sigma_{0}^{2}$,
where $\sigma_{0}^{2}$ is given by

$\sigma_{0}^{2}=Var\Big{(}X^{2}\bar{F}(X)+\int_{-\infty}^{X}y^{2}dF(y)\Big{)}.$
(11)

Rejection region of the test based on $\widehat{\Delta}$ can be constructed
using Corollary 1. We reject the null hypothesis $H_{0}$ against the
alternative hypothesis $H_{1}$ at a significance level $\alpha$, if

$\frac{\sqrt{n}|\widehat{\Delta}|}{\widehat{\sigma}_{0}}>Z_{\alpha/2},$

where $Z_{\alpha}$ is the upper $\alpha$-percentile point of the standard
normal distribution and $\widehat{\sigma}_{0}^{2}$ is a consistent estimator
of the null variance $\sigma_{0}^{2}$.

As $F$ has no closed form for the normal distribution, it is difficult to
evaluate the null variance specified in (11). Hence it is not easy to
implement the normal based test in practice. Motivated by this fact, we
develop a jackknife empirical likelihood ratio test for testing normal
distribution.

###  2.2. JEL based test

For developing jackknife empirical likelihood ratio test, first we define the
jackknife pseudo values using the test statistic given in equation (6). The
jackknife pseudo values denoted by $\nu_{i},\,i=1,\ldots,n$ are defined as

$\nu_{i}=n\widehat{\Delta}-(n-1)\widehat{\Delta}_{i},\,\,i=1,\ldots,n.$

where $\widehat{\Delta}_{i}$ is the value of the test statistic obtained using
the equation (6) by deleting the $i$-th observation in the sample
$X_{1},...,X_{n}$. Let $p=(p_{1},\ldots,p_{n})$ be a probability vector. It is
well-known that $\prod_{i=1}^{n}p_{i}$ subject to $\sum_{i=1}^{n}p_{i}=1$
attain its maximum value $n^{-n}$ at $p_{i}=1/n$. Hence the jackknife
empirical likelihood ratio for testing normal distribution based on the
departure measure $\Delta(F)$ defined in equation (1) is defined as

$R(\Delta)=\max\Big{\\{}\prod_{i=1}^{n}np_{i},\,\,\sum_{i=1}^{n}p_{i}=1,\,\,\sum_{i=1}^{n}p_{i}\nu_{i}=0\Big{\\}},$

where

$p_{i}=\frac{1}{n}\frac{1}{1+\lambda\nu_{i}}$

and $\lambda$ satisfies

$\frac{1}{n}\sum_{i=1}^{n}\frac{\nu_{i}}{1+\lambda\nu_{i}}=0.$

Hence the jackknife empirical log likelihood ratio is given by

$\log R(\Delta)=-\sum\log(1+\lambda\nu_{i}).$

We reject the null hypothesis $H_{0}$ against the alternative hypothesis
$H_{1}$ for large values of $\log R(\Delta)$. To find the critical region of
the JEL based test we find the limiting distribution of the jackknife
empirical log likelihood ratio. Using Theorem 1 of Jing et al. (2009) we have
the following result as an analogue of Wilk’s theorem.

######  Theorem 4.

If $E(h^{2}(X_{1},X_{2}))<\infty$ and $\sigma_{1}^{2}>0,$ then as
$n\rightarrow\infty$, $-2\log R(\Delta)$ converges in distribution to
$\chi^{2}$ with one degree of freedom.

Proof: In view of the Theorem 3, the assumptions
$E(h^{2}(X_{1},X_{2}))<\infty$ and $\sigma_{1}^{2}>0$ always hold.
Accordingly, by Lemma A1 of Jing et al. (2009) we have the condition

$\min_{{1\leq k\leq n}}v_{k}<\widehat{\Delta}<\max_{1\leq k\leq n}v_{k}.$

Hence the proof follows from the Theorem 1 of Jing et al. (2009).

Using Theorem 4 we can obtain the critical region of the JEL based test. In
jackknife empirical likelihood ratio test, we reject the null hypothesis
$H_{0}$ against the alternatives hypothesis $H_{1}$ at a significance level
$\alpha$, if

$-2\log R(\Delta)>\chi^{2}_{1,\alpha},$

where $\chi^{2}_{1,\alpha}$ is the upper $\alpha$-percentile point of the
$\chi^{2}$ distribution with one degree of freedom.

##  3\. Empirical evidence and data analysis

To study the finite sample performance of the JEL based test, we conduct a
Monte Carlo simulation using R package. The simulation is repeated ten
thousand times. To show the competitiveness to existing test procedures we
compare the power of our test with that of Anderson-Darling and Jarque-Berra
tests. We illustrate our test procedure using two real data sets.

###  3.1. Monte Carlo Simulation

First we find the empirical type I error of the proposed test. For finding the
empirical type I error, we generated samples from standard normal distribution
and the results of the simulation study are given in Table 1. From the Table 1
we observe that the empirical type I error is a very good estimator of the
size of the test.

Table 1. Empirical type I error $n$ | 5% level | 1% level
---|---|---
25 | 0.1040 | 0.0185
50 | 0.0617 | 0.0167
75 | 0.0585 | 0.0142
100 | 0.0551 | 0.0140
150 | 0.0524 | 0.0112
200 | 0.0504 | 0.0101

Next, based on empirical power we evaluate the performance of our test against
various alternatives. For finding empirical power against different
alternatives, we simulate observations from Gumbel ($\theta,\,1$), log normal
($0,\theta$) and $t$ distributions. The empirical powers obtained for the
above mentioned alternatives are reported in the Tables 2-4. From Tables 2-3,
we observe that empirical powers of the test approaches one for large values
of $n$. In the case of Gumbel distribution the empirical power is very high
even for small sample sizes when the value of $\theta$ is away from zero. From
Table 4 we see that the power is very low when the degrees of freedom of the
$t$ distribution increases. This may be due to the fact that $t$ distribution
become closer to the normal distribution as degrees of freedom increases.

We also compare our test with two well-known tests of normal distribution.
First we consider the Anderson-Darling test given by

$T_{1}=-n-\frac{\sum_{i=1}^{n}(2i-1)\\{\log(Z_{i})+\log(1-Z_{n-i+1})\\}}{n},$

where $Z_{i}=\Phi\big{(}\frac{X_{(i)}-\bar{X}}{S_{X}}\big{)}$ with $\bar{X}$
is the sample mean and $S_{X}^{2}$ is the sample variance. Here $\Phi$ is the
cumulative distribution function of standard normal random variable. We
compare the test statistics value with the critical point $2.492$ and $3.857$
when the significance levels are $0.05$ and $0.01$, respectively (Anderson and
Darling, 1954).

Next, we consider the Jarque-Berra test given by

$T_{2}=\frac{n}{6}\big{(}S^{2}+\frac{1}{4}(K-3)^{2}\big{)},$

where

$S=\frac{1}{n}\sum_{i=1}^{n}(X_{i}-\bar{X})^{3}/\big{(}\frac{1}{n}\sum_{i=1}^{n}(X_{i}-\bar{X})^{2}\big{)}^{3/2}$

and

$K=\frac{1}{n}\sum_{i=1}^{n}(X_{i}-\bar{X})^{4}/\big{(}\frac{1}{n}\sum_{i=1}^{n}(X_{i}-\bar{X})^{2}\big{)}^{2}.$

Under $H_{0}$, the asymptotic distribution of $T_{2}$ is $\chi^{2}$ with two
degrees of freedom.

We compare the empirical power of our test with Anderson-Darling and Jarque-
Berra tests for standard Gumbel, standard log normal and Gamma (1,2)
distributions. The results of the simulation study are reported in Tables 5-7.
From Table 5, we observe that our test is comparable with Anderson-Darling
test for large sample sizes and it is better than Jarque-Berra test for all
values of $n$. For standard log normal distribution, our test and Jarque-Berra
test perform better than Anderson-Darling test. Our test has very good power
even for small values of $n$. From Table 7, we observe that the empirical
power of the JEL ratio test and Anderson-Darling test perform better than
Jarque-Berra test in case of gamma distribution.

Table 2. Empirical Power: Gumbel distribution | $\theta=0$ | $\theta=0.5$ | $\theta=1$ | $\theta=2$
---|---|---|---|---
$n$ | 5% level | 1%level | 5% level | 1%level | 5% level | 1%level | 5% level | 1%level
25 | 0.4472 | 0.2568 | 0.9580 | 0.9089 | 0.9981 | 0.9900 | 1.0000 | 1.0000
50 | 0.7108 | 0.4464 | 0.9989 | 0.9998 | 1.0000 | 1.0000 | 1.0000 | 1.0000
75 | 0.9152 | 0.6914 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000
100 | 0.9678 | 0.8284 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000
200 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000
Table 3. Empirical Power: Log normal distribution  | $\theta=0.5$ | $\theta=1$ | $\theta=1.5$ | $\theta=2$
---|---|---|---|---
$n$ | 5% level | 1%level | 5% level | 1%level | 5% level | 1%level | 5% level | 1%level
25 | 1.0000 | 1.0000 | 0.9997 | 1.0000 | 0.9592 | 0.8729 | 0.7014 | 0.3961
50 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9958 | 0.9538 | 0.8632 | 0.5573
75 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9880 | 0.9266 | 0.7228
100 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9940 | 0.9685 | 0.8150
200 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9980 | 0.9914 | 0.9432
Table 4. Empirical Power: $t$ distribution | $df=1$ | $df=2$ | $df=3$ | $df=4$
---|---|---|---|---
$n$ | 5% level | 1%level | 5% level | 1%level | 5% level | 1%level | 5% level | 1%level
25 | 0.7494 | 0.6552 | 0.5777 | 0.4324 | 0.3798 | 0.2438 | 0.2972 | 0.1786
50 | 0.8750 | 0.8248 | 0.7813 | 0.6437 | 0.5913 | 0.4298 | 0.4029 | 0.2544
75 | 0.9048 | 0.8657 | 0.8922 | 0.8016 | 0.6904 | 0.5499 | 0.5152 | 0.3409
100 | 0.9139 | 0.8743 | 0.9448 | 0.8974 | 0.8058 | 0.6708 | 0.6412 | 0.4498
200 | 0.9546 | 0.9304 | 0.9990 | 0.9920 | 0.9662 | 0.9306 | 0.8887 | 0.7776
Table 5. Empirical Power Comparison: Standard Gumbel  | Proposed test | $T_{1}$ | $T_{2}$
---|---|---|---
$n$ | 5% level | 1%level | 5% level | 1%level | 5% level | 1%level
25 | 0.4604 | 0.2643 | 0.6582 | 0.4748 | 0.3158 | 0.2352
50 | 0.7002 | 0.4286 | 0.9214 | 0.7906 | 0.5481 | 0.4278
75 | 0.8990 | 0.6682 | 0.9880 | 0.9334 | 0.7770 | 0.6542
100 | 0.9676 | 0.8600 | 0.9975 | 0.9886 | 0.9038 | 0.7930
200 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9974 | 0.9842
Table 6. Empirical Power Comparison: Standard log normal | Proposed test | $T_{1}$ | $T_{2}$
---|---|---|---
$n$ | 5% level | 1%level | 5% level | 1%level | 5% level | 1%level
25 | 1.0000 | 1.0000 | 0.3253 | 0.0999 | 0.8437 | 0.7355
50 | 1.0000 | 1.0000 | 0.8790 | 0.5736 | 0.9970 | 0.9821
75 | 1.0000 | 1.0000 | 0.9924 | 0.9418 | 1.0000 | 1.0000
100 | 1.0000 | 1.0000 | 1.0000 | 0.9934 | 1.0000 | 1.0000
200 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000
Table 7. Empirical Power Comparison: Gamma (1, 2) | Proposed test | $T_{1}$ | $T_{2}$
---|---|---|---
$n$ | 5% level | 1%level | 5% level | 1%level | 5% level | 1%level
25 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.6068 | 0.4662
50 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9574 | 0.8738
75 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9990 | 0.9875
100 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.9971
200 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 1.0000
Figure 1. Histogram of the body temperature

###  3.2. Data Analysis

To discuss the application of our test procedure we consider two real data
sets. First we consider the body temperature of 65 men measured in Fahrenheit
scale which is reported in Villaseñor-Alva and González-Estrada (2015) and the
details about the data can be found at
http://www.amstat.org/publications/jse/v4n2/datasets.shoemaker.html.
The calculated value of the test statistic $-2\log R(\Delta)$ for the
standardized data is 0.0766, which suggest that the underlying data follows
normal distribution. This is evident from the histogram (Figure 1) of the data
and the result is parallel with the results obtained by many others.

Next we consider the height of 99 five-year-old British boys in cm downloaded
from http://www.mas.ncl.ac.uk/ njnsm/medfac/docs/intro.pdf. The value of JEL
based test is 0.0247 and it suggest that the data follows normal distribution.

##  4\. Concluding remarks

Stein’s identity for normal random variable and its applications in different
areas have been explored by many researchers. Based on Stein’s
characterization, we developed a goodness of fit test for normal distribution.
We also developed a jackknife empirical likelihood ratio test for testing
normal distribution. Using Monte Carlo simulation study, we have shown that
the jackknife empirical likelihood ratio test has well controlled type I error
rate and good power for various alternatives. The Simulation study also show
that the proposed test is comparable with some well-known classical tests
available in the literature. Finally, we illustrated our test procedure using
two real data sets.

Sudheesh (2009) generalized the Stein’s identity to a general class of
probability distributions. Using this generalized identity one can find
Stein’s characterization for different distributions. Recently, based on
Stein’s method, Betsch and Ebner (2020) provided characterization identities
for a large class of absolutely continuous probability distributions. Using
these Stein’s type characterization identities one can develop goodness of fit
tests for different univariate continuous distributions. This paper and recent
works by Betsch and Ebner (2019a, 2019b) are good starting points in this
direction.

## References

  * [1] Anderson, T. W. and Darling, D. A. (1954). A test of goodness of fit. Journal of the American Statistical Association, 49, 765–769.
  * [2] Bera, A. K., Galvao, A. F., Wang, L. and Xiao, Z. (2016). A new characterization of the normal distribution and test for normality. Econometric Theory, 32, 1216–1252.
  * [3] Betsch, S. and Ebner, B. (2019a). Testing normality via a distributional fixed point property in the Stein characterization. TEST, 1–34.
  * [4] Betsch, S. and Ebner, B. (2019b). A new characterization of the Gamma distribution and associated goodness-of-fit tests. Metrika, 82, 779–806.
  * [5] Betsch, S. and Ebner, B. (2020). Fixed point characterizations of continuous univariate probability distributions and their applications. Annals of the Institute of Statistical Mathematics, 1–29.
  * [6] Henze, N. and Koch, S. (2017). On a test of normality based on the empirical moment generating function. Statistical Papers, 1–13.
  * [7] Jing, B. Y., Yuan, J. and Zhou, W. (2009). Jackknife empirical likelihood. Journal of the American Statistical Association, 104, 1224–1232.
  * [8] Lehmann, E. L. (1951). Consistency and unbiasedness of certain nonparametric tests. The Annals of Mathematical Statistics, 22, 165–179.
  * [9] Lee, A. J. (1990). U-Statistics: Theory and Practice, Marcel Dekker Inc., New York.
  * [10] Nikitin, Y. Y. (2018). Local exact Bahadur efficiencies of two scale-free tests of normality based on a recent characterization. Metrika, 81, 609–618.
  * [11] Ross, N. (2011). Fundamentals of Stein’s method. Probability Surveys, 8, 210–293.
  * [12] Sudheesh, K. K. (2009). On Stein’s identity and its applications. Statistics & Probability Letters, 79, 1444–1449.
  * [13] Sudheesh, K. K. and Dewan, I. (2016). On generalized moment identity and its applications: A unified approach. Statistics, 50, 1149–1160.
  * [14] Sulewski, P. (2019). Modified Lilliefors goodness-of-fit test for normality. Communications in Statistics-Simulation and Computation, 1–21.
  * [15] Thode, H. C. (2002). Testing for Normality, Marcel Dekker, New York.
  * [16] Zamanzade, E. and Arghami, N. R. (2012). Testing normality based on new entropy estimators. Journal of Statistical Computation and Simulation, 82, 1701–1713.
  * [17] Villaseñor-Alva, J. A. and González-Estrada, E. (2015). A correlation test for normality based on the Lévy characterization. Communications in Statistics-Simulation and Computation, 44, 1225–1238.


# Why blockchain and smart contracts need semantic descriptions

Zoran Škoda

###### Abstract

We argue that there is a hierarchy of levels describing to that particular
level relevant features of reality behind the content and behavior of
blockchain and smart contracts in their realistic deployment. Choice, design,
audit and legal control of these systems could be more informed, easier and
raised to a higher level, if research on foundations of these descriptions
develops and sets the formalisms, tools and standards for such descriptions.

##  1 Introduction

Blockchains and smart contracting platforms are usually presented either in
rather algorithmic (or architectural) manner, emphasizing technical
implementation or as highly idealized and simplified devices for highly
controllable application scenarios. Surely, there is some common awareness of
fallability or misuse of some of intended mechanisms which is typically
attributed to a rather vague dependence on surrounding “ecosystem”. While
these pictures are suitable for some engineerings tasks, or as a first
introduction to users, they are typically insufficient for critical analysis
needed by those initiating or systematically controlling their deployment, say
policy makers, platform choosers, smart contracting platform architects. If
this technology becomes prominent in real life clarity of recommendation will
become a daily need. To give a metaphore, if we need to use a vehicle it is
not sufficient to take some vehicle and to know how to drive one vehicle, but
the vehicle and driving have to be appropriate, should it be a bike, boat,
jeep, tank, motorcycle, an airplane or dirigible. The features of blockchains
and smart contracts are even more diverse while much more opaque to observe
than in the vehicle metaphore.

It will take us a while to describe what we mean by semantic description and
the account below is somewhat personal. In different areas, like philosophy,
linguistics, computer science and logic, semantics refers to a slightly
different concept or a subdiscipline. Our search is maybe closest to the usage
in programming languages context. In early times of programming, code was
written mainly ad hoc using whatever tricks and tools, which gradually
included sophisticated compilers, debuggers, task scheduling in engineering
teams and so on. Regardless sophistication, a question arose if two different
implementations really operate the same, is the code verifiably correct and so
on. Therefore the meaning and/or operational content should in particular be
in some sense the same, whatever correct implementation is. Hence one had to
answer the question what is the operational content, what is the effect of the
code. Different approaches like denotational and operational semantics, agent
model etc. are devised to define properly and model this content.

Blockchains and more general distributed ledgers are distributed systems
physically realized by a network of computers as nodes, whose making involves
concurrency, consensus and possibly adversaries in the system. Hence its
behaviour is not fully predictable. However, the genius of the invention is
that incentives to parties operating in the system make certain aspects of
handling the data which enter the ledger, which includes smart contracts, well
behaved, reliable, replicable and so on to large extent. For some consensus
mechanisms, very recent data on the ledger may be only tentative as choice of
recognized fork takes some latency time and leads to abandoning some very
recent blocks. The data on the ledger are processed and checked multiple times
by varios nodes, leading to inefficiencies in addition to the inefficiencies
which come from the computational price of consensus mechanism, say proof of
work. For reasons of scalability and price, some data which logically have
direct meaning to the algorithms in smart contracts on chain (= written in the
ledger) are stored off chain, and only the handles (hashes or other
identifiers) are stored on the chain. The hashes on the chain make verifying
that the off chain data are correct cryptographic provable, however additional
incentives are needed to mitagate the risk of unavailability of these data to
complete the information needeed in the algorithms of smart contracts on
chain. Thus, the availability of off chain data is one semantic characteristic
of these data, which makes reality of smart programs very different then when
the data are completely on chain. This is still engineering level, recognized
in blockchain community.

Much deeper problems happen when we include in the consideration meaning of
the data processed by smart contracts in real world, like tokenized
representations of assets, witness statements on achieved milestones in real
world, timing information and so on. Clear picture is of ultimate importance
for security of smart contracts: can contracts be explored by third parties,
how to resolve conflicts, what is the risk analysis for assets and finally how
should courts analyze and judge about the intended content and resolve the
abuse, conflicts or technical glitches in procedures involving smart
contracts. Some of the assets, like cryptocurrencies have their reality on
chain and analysis of risks is limited to on chain plus possibly some off
chain related second layer platform data. Many such analyses exist already.
Next level is considering witness mechanisms. There are several cryptographic
mechanisms how information about real world is verified on blockchain. First
of all, smart contract can name holders of cryptographic keys of some
blockchain addresses as verified witnesses who can enter information into a
smart contract and this information is considered relevant, that is
nontrivially influences the computation. These are usually called oracles. In
a variant, oracle addresses are not predetermined but anybody who puts certain
stake can be an oracle, and information is weighted over a pool of oracles who
are rewarded for information but whose part of a stake is taken if the
oracle’s prediction is incorrect in the sense that it is far from the
information given by majority of other oracles. This system is more in the
spirit of decentralization than in advance certified oracles, but it requires
handling the oracle market, which needs volume, good balance of incentives and
may suffer from usual ideas of gaming the system which happen in rating and
popularity systems. Oracle mechanisms may be combined with more involved
cryptographic proofs from off chain world. That means that on chain, there is
a preset verification test which can verify the cryptographic proof.

Let us also mention the timing. Unlike usual programs which may run
continuously and interact with surrounding signals during that execution,
smart contracts run only when they are called, and the execution finishes
within one block. There can be complementary off chain device which may be
able to initiate a call to a program and take care to do it at right time. The
blockchain itself has very rough timing information in the blocks, precise
consensus on time is usually not present and it is difficult to incorporate
beyond very rough precision. Of course, a smaft contract can itself call
another smart contract and we can have a chain of executions. There are now
variants, depending on blockchain in place. Either calls have to be executed
also within the same block in which the original smart contract has been under
execution or only a message has been written on chain by one smart contract to
another and then this message will be interpreted as a call in the next block.
The latter is useful if the platform is such that sharding has been
extensively used, that is one divides the job between groups of miners, and
then if a call has been made for a contract in a differeng shard it may be not
feasible to execute within the same computing cycle but rather a request is
made via a message which is on chain.

##  2 Basics on what is semantics

To setup our problem it is good to rethink of what a semantics can be. In
different disciplines like philosphy, linguistics, computer science, and
logic, by semantics we mean somewhat different things. Maybe we could say that
a common ground is that the situation considered in most settings is that we
have some sort of reality and a presentation of this reality in somewhat
symbolic terms, say a thought, language construct, formal language construct,
computer program. There have been volumes of philosophical discussion on the
character of the correspondence between the presentation and the reality. In
the case of human language a convention sets up what is the standard
interpretation of some utterance. According to Hirsch [8], however the only
consistent interpretation of human texts is the one which tries to find which
meaning has been intended by the creator of the text; other interpretations
are possible to produce but do not truly pertain to the task of text
interpretation. Thus, the linguistic conventions are not exhaustive factors in
human communication. Our experience brings awareness that while our thoughts
can be arbitrary, interaction with other beings and our existence make that
our arbitrary will is useless in comparison to following patters in appearance
of new reality from known reality. This brings distinguishing some facts as
more real, truthful to others, and some sequences of thoughts as regularly
bring new things again as real, hence conclusions of truthful statements. The
reasonings in that endeavor boil down to logical reasoning, not only
classical, but if reality is understood in various senses of useful
experience, including conditional, hypothetical, contractual and so on leading
to various kinds of logic. These reasoning chains are as a rule finite. Our
experience can simply not confirm others, except indirectly as artifacts of
finite ones, though reality also may have non finite ones which we do not
comprehend as part of our experience. Formalization of such logical systems,
and axiomatic bases of knowledge can again be presented in terms of finite
presentations by states in a computer or sequences (or nonlinear utterances)
of symbols. Formalization then has two aspects, one is the system of
utterances itself (basic symbols and the syntax use to organize more
complicated systems from basic symbols), another is the intended
representation. One can however have another system for which, using the same
rules of logical reasonings, one can have valid reasoning for a different
intended reality. In mathematical logic these are called models.

In the study of computing, programs are producing reality rather than proofs,
at least at first inspection. This reality can be abstracted to operations
which happen with data (operational semantics), or we can go toward assigning
denotations to programming language constructs which will correspond again to
the reality of program execution. This is very vague, but enough for rough
comparison that we are talking about the same subject. Again the program is
just a symbolic presentation which has no meaning outside of the system.
Knowing how to present semantics of a computer language is extremely
important. For example, if we change a platform and redo programming some
critical system for this platform in the langauge suitable for this platform
do we get the same ? Do the outputs of compiling the same code by two
different compilers give the same output ? Usually, computer languages do not
have fully determined semantics by their design. Namely there are situations
where an undefined behavior is possible (say choices). Some languages are
designed so that their semantics is very predictable, especially functional
languages what makes them more relevant in recent years. These languages are
designed having in mind semantics of type theory [ChlipalaGirard], a flavor of
a logical system which came out of philosophy and logic but has wide
applications nowdays. Programs in this world can be viewed as producing proofs
of truth for some logical deductions. Useful theoretical connections to
category theory are widely explored.

Regarding that the early languages for smart contracts (say, Solidity) are
rather ad hoc written without advanced programmin language theory properly
adapted to blockchain, some systems nowdays produce smart contracts from
functional languages, then there is an intermediate presentation which
formalizes some level of semantics, which is prone to better analysis, for
verification, security and other reasons. Then, from the intermediate
representation one produces automatically, in a way similar to code generation
in compilers, an actual program in old fashioned smart contract language.
Optimization reasons suggest nowdays that the operational content should be
done in low level bytecode virtual machines and Webassembly VM seem to be a
tendency, complemented by system interface (set of standardized system calls
from VM). This way modularity of interaction between the execution in VM and
other aspects of blockchain and of off chain reality is recognized, but not
sufficiently modeled at abstract level.

##  3 Assets on blockchain

Handling off chain assets on blockchain requires a representation of the
assets on blockchain, most usually, but not exclusively, in tokenized form.
This is in a complete analogy to an auction. In an auction, parties sign up
before an auction and they are preverified for ability to pay. During the
auction no real money is involved, certified party enters purchase by a
promise statement. After the auction, off auction mechanisms are involved to
collect the money promised. Similarly, an off chain asset is represented on
the blockchain showing the representation of the asset and a blockchain
address of the owner (the owner may be even some other smart contract). Now a
number of issues come into play. First of all, with cryptocurrencies a double
spending problem is solved on chain but the existence and possible multiple
representations in different systems of a real asset can be regulated only off
chain, in real world and with help of a legal system. Say, if some
jurisdiction decides that all real estate in this jurisdiction is represented
on some blockchain as a primary place of verification, then the issuer of real
world certificate to this property, and that is the jurisdiction itself is the
default place of a resolution of a conflict. Namely if some property is sold
elsewhere and not on the authorized blockchain it should be considered legally
not binding, and in most cases cheating or criminal misappropriation.

Most proponents of smart contracts in past put the emphasis on variants of
smart contracts which contain also the legal statements written on blockchain,
describing the smart contract in legal terms. These so called Ricardian
contracts are hence a pair of a real contract and a smart contract. This is
typically considered as safe if the legal contract described the smart
contract sufficiently precisely. One can always have a less verbose real
contract which just says, accept whatever this code gives, making the promise
to respect the outcome of the contract, but this opens the possibility that if
one side of a contract is technically superior there can be hidden advantages
in a contract designed and offered by such a side. This is very similar to the
notion of business intelligence, but it is far ore opaque. In the case of
business intelligence, say, a bank user opens an account or more complicated
financial device and signs some document with the bank. The account is handled
by a program set up by the bank, and has many defaults hwihc are typically not
specified in the account and it is often not fully in agreement with all
exceptions which exist elsewhere in the law or are tacit assumptions of the
user when signing the contract about the financial device. If a user sees that
something worked out different from the intution, the bank representative will
usually say this is the way our computer handles this situation, I am sorry
for this, but this is the business rule. It appears as the business logic
within the bank is above the external contract between the bank and the user
and brings additional rules which are not in the contract. This is an abuse of
power by the bank per excellence. Now if the business logic is replaced by
procedures on the blockchain then in principle, the user can check the
correctness and so on and does not rely on hidden third party software and
unchecked computation within the bank (we are neglecting the problem of
account privacy here, as we consider a different aspect). But still the user
can not have a way to audit the system without third party services. And even
then, if we come to the court, is there a decription of the reality behind the
smart contract which makes the implications of the contract clear enough for a
court resolution. The fact that the code is visible, at least, and the
execution deterministic (up to factors like the content of oracle messages,
execution timing etc.), makes it less attractive to cheating. The collection
of processing data is simpler and achieving to a conclusion is simpler as long
as parties do not dispute the content of the smart contract but only following
or not in real world the consequences of the actions of smart contracts on
symbolic representations of real world assets.

In traditional systems there are some mechanisms of handling the inequality in
comprehension of contracts. This rules are hard to enforce in practice as it
is hard to prove both the intention to cheat, and miscomprehension of a side
in a contract. In situations like selling a material item over the internet,
there is a tendency in law that a customer (the weak party) should read more
details of the contract if it is expected that (s)he is less familiar. For
example, if you already used the service or if you are profiled as highly
educated the system may simplify the procedure in which you are forced to
check for more details. This is one of the prime cases belonging to the
subject of the personalized law [2, 3].

##  4 Hierarchies

Which parts of the blockchain reality or smart contract reality we should
model? It is important for a problem (say a security analysis, risk analysis,
legal analysis, porting to another platform, refactoring code) to be able to
limit the content to a closed system using only idalizations abstracting from
phenomena which are either irrelevant or could be separately modelled.

The very basic one is off chain and on chain in the strict sense. Hence we do
not imply the data or programs which are represented by hashes on the
blockchain or which are initiated by change of flags on the blockchain. Even
this basic reality of transactions in blocks may have variants. One is to
include or not the temporary forks which may be dispenses later. Another is
how deeply we go into the semantic of data within the on chain transactions.
For example, do we take into account the data as programs (smart contracts) or
not.

Now say, we consider smart contracts as programs. These programs do not
execute when we want. Namely, in each block miners include some transactions,
these transactions may be calls to smart contracts from the account or from
other smart contracts together with a trace these smart contracts make on
chain, that is the part of the results of execution which concern the global
variables, those whose value is written on chain. There are incentives that
the miners include certain transactions but it may be that a transaction is
delayed several blocks just because it happens that the miners selected other
transactions as more interesting for inclusion into blocks.

Typically most variables of a smart contract are off chain. Do we work in
idealization in which these data are available or we take into account
conditional semantics in which these data are not secured ?

There are two very different problems we want to describe and this is in a
complete analogy with programming languages. In the latter case, one is the
semantics of a programming language in the sense of a model how to model all
programs in that programming language. In a research people study aspect by
aspect of a programming language when doing this. Another is the semantic
representation of an instance, a particular program. This assumes producing
tools, used say for verification or so. The two realities are not much
different in that case. In the case of smart contracts, however, studying the
expressive content of say a smart contracting language is usually at a higher
level of abstraction than when we study the content of a particular system of
smart contract. In the latter case, the semantics of data used, may be
considered in a more speciic way, if we know the context. So, without a
context, say a variable of type asset is sort of class which has some
features, for example it is desirable that the language does not allow making
copies but only transfer of the asset values. Such things were already used in
the design of a more advanced languages for smart contracts, say Libra’s Move
language. In a context, we may have an information which is not part of the
semantics of the smart contracting language. For example, we may know that
some oracle’s addresses are trusted and others are semireliable or behave as
selfish agents collecting rewards in a way regulared by given smart contracts.
Thus the semantics of the programming language for smaft contract, which is
already specific is less expressive than the semantics needed to model some
smart contract in the context. From the point of view of research, although
the real life contexts are limitless, we indeed have some typical colorings of
the data which mainly center around the notions of availability, trust and
timeliness.

The whole situation is also prone to cryptographic factors. Users can loose
cryptographic keys, keys can be compromised and the information in various
channels of execution can or can not see information in other channels due
encryption, off chain execution mechanisms and so on. This is the usual
situation in distributive systems. Concurrency and cryptography has been
studied extensively using agent systems, process algebra, modal logic and its
modal theory, some aspects of which like Kripke models, bisimulation etc.
appear also in categorical treatments.

Another aspect is when moving part of the computation to a state channel of
chain. Namely, for scalability purposes allowing wider applications, or for
privacy or other reasons, one can sometimes move some computation off chain
and expect some guarantees that the computation has been correct. It can be a
cryptographic proof, or else, all interested parties for a subset of smart
contracts instances, may be present in side channel with the same
computational rules as on the main chain and if a computation in some step of
the channel does not follow the rules a party can challenge the execution on
the main chain. The steps in between are digitally signed so the complaining
party has the proof that the block before the challened block happened. Then a
verfication game can resolve the dispute at the level of the main chain. Now,
the execution in state channel uses some data from the main chain which were
withdrawn to the channel, for example, some assets can be frosen on the main
chain and used for the computation in the channel and then at the moment of
closing he channel, many blocks later, the redistributed assets are returned
to the main chain. This phenomenon of temporary passing of a part of the state
to a channel is usually regulated by the rules of another system of smart
contracts which establishes the mechanism of setting up the channel. Thus this
is not a characteristic of a blockchain itself, but of a smart contracting
platform which includes the system of contracts regulating the issue. Of
course, such mechanisms can be included potentially in the basic protocol of
some blockchain and the instances will just require signing up to an
instantiation of such a channel. However this is not obvious as it is not
clear which kind of variables other than most simple asset types can figure
out in such channeling procedures.

It is an open question how to make these potential models compatible with the
reality of the contract legislation, which should adapt to smart contracts as
a variant with classica issues like incompleteness of contracts, conflict
resolution etc. [10]

## References

  * [1] S. Blackshear et al. (Libra/Diem foundation), Move: A Language With Programmable Resources, 27 pp., May 2020
  * [2] Christoph Busch, Implementing personalized law: personalized disclosures in consumer law and data privacy law, The University of Chicago Law Review 86:2, Symposium: Personalized Law (2019) 309-3
  * [3] C. Busch, A. De Franceschi, Algorithmic regulation and personalized law, A handbook, 300 pp., Dec 2020, Beck/Hart
  * [4] Adam Chlipala, Certified programming with dependent types, MIT Press, 2021
  * [5] Nikolai Durov, Telegram Open Network, 132 pp., Dec 2017
  * [6] S. Dziembowski, S. Faust, K. Hostakova, Foundations of state channel networks, Cryptology ePrint Archive, eprint.iacr.org/2018/320
  * [7] Jean-Yves Girard, Proofs and types, Cambridge Tracts in Theoretical Comp. Sci. 7, CUP 1989
  * [8] E. D. Hirsch, Validity of interpretation, Yale Univ. Press 1971
  * [9] John Lyons, Semantics, 2 vols, Cambridge Univ. Press 1977
  * [10] C. MacMillan, Mistakes in contract law, 322 pp. Oxford and Portland, 2010
  * [11] Per Martin-Löf, A path from logic to metaphysics, Atti del Congresso Nuovi problemi della logic e della filosofia della scienza, Viareggio, 8-13 gennaio 1990. pp. 141–149.
  * [12] Zoran Škoda, Idealized versus realistic blockchain, in preparation
  * [13] Glynn Winskel, Formal semantics of programming languages, MIT Press 1993