SlideShare a Scribd company logo
1 of 20
Download to read offline
Static typing and proof in ATS
language
Static typing and proof in ATS
language
Static typing and proof in ATS
language
Static typing and proof in ATS
language
Static typing and proof in ATS
language
Kiwamu OkabeKiwamu OkabeKiwamu OkabeKiwamu OkabeKiwamu Okabe
Let's make Rock-paper-scissors libraryLet's make Rock-paper-scissors libraryLet's make Rock-paper-scissors libraryLet's make Rock-paper-scissors libraryLet's make Rock-paper-scissors library
☆ �じゃんけん� in Japanese.☆ �じゃんけん� in Japanese.☆ �じゃんけん� in Japanese.☆ �じゃんけん� in Japanese.☆ �じゃんけん� in Japanese.
R-P-S in C language #1R-P-S in C language #1R-P-S in C language #1R-P-S in C language #1R-P-S in C language #1
#include�<stdio.h>
#include�<stdlib.h>
typedef�enum�{
R_RPS_T�=�0,�/*�Rock�*/
P_RPS_T,�����/*�Paper�*/
S_RPS_T������/*�Scissors�*/
}�rps_t;
void�print_rps(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
printf("Rock");�break;
case�P_RPS_T:
printf("Paper");�break;
case�S_RPS_T:
printf("Scissors");�break;
}
}
#include�<stdio.h>
#include�<stdlib.h>
typedef�enum�{
R_RPS_T�=�0,�/*�Rock�*/
P_RPS_T,�����/*�Paper�*/
S_RPS_T������/*�Scissors�*/
}�rps_t;
void�print_rps(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
printf("Rock");�break;
case�P_RPS_T:
printf("Paper");�break;
case�S_RPS_T:
printf("Scissors");�break;
}
}
#include�<stdio.h>
#include�<stdlib.h>
typedef�enum�{
R_RPS_T�=�0,�/*�Rock�*/
P_RPS_T,�����/*�Paper�*/
S_RPS_T������/*�Scissors�*/
}�rps_t;
void�print_rps(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
printf("Rock");�break;
case�P_RPS_T:
printf("Paper");�break;
case�S_RPS_T:
printf("Scissors");�break;
}
}
#include�<stdio.h>
#include�<stdlib.h>
typedef�enum�{
R_RPS_T�=�0,�/*�Rock�*/
P_RPS_T,�����/*�Paper�*/
S_RPS_T������/*�Scissors�*/
}�rps_t;
void�print_rps(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
printf("Rock");�break;
case�P_RPS_T:
printf("Paper");�break;
case�S_RPS_T:
printf("Scissors");�break;
}
}
#include�<stdio.h>
#include�<stdlib.h>
typedef enum�{
R_RPS_T�=�0,�/*�Rock�*/
P_RPS_T,�����/*�Paper�*/
S_RPS_T������/*�Scissors�*/
}�rps_t;
void�print_rps(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
printf("Rock");�break;
case�P_RPS_T:
printf("Paper");�break;
case�S_RPS_T:
printf("Scissors");�break;
}
}
R-P-S in C language #2R-P-S in C language #2R-P-S in C language #2R-P-S in C language #2R-P-S in C language #2
int�main()�{
rps_t�paper_d�=�P_RPS_T;
rps_t�win_d�=�rps_win_d�(paper_d);
print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n");
/*�=>�Scissors�win�Paper.�*/
rps_t�even_d�=�rps_even_d(win_d,�paper_d);
print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d);
printf("�and�");�print_rps(paper_d);�printf(".n");
/*�=>�Rock�is�even�between�Scissors�and�Paper.�*/
}
int�main()�{
rps_t�paper_d�=�P_RPS_T;
rps_t�win_d�=�rps_win_d�(paper_d);
print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n");
/*�=>�Scissors�win�Paper.�*/
rps_t�even_d�=�rps_even_d(win_d,�paper_d);
print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d);
printf("�and�");�print_rps(paper_d);�printf(".n");
/*�=>�Rock�is�even�between�Scissors�and�Paper.�*/
}
int�main()�{
rps_t�paper_d�=�P_RPS_T;
rps_t�win_d�=�rps_win_d�(paper_d);
print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n");
/*�=>�Scissors�win�Paper.�*/
rps_t�even_d�=�rps_even_d(win_d,�paper_d);
print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d);
printf("�and�");�print_rps(paper_d);�printf(".n");
/*�=>�Rock�is�even�between�Scissors�and�Paper.�*/
}
int�main()�{
rps_t�paper_d�=�P_RPS_T;
rps_t�win_d�=�rps_win_d�(paper_d);
print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n");
/*�=>�Scissors�win�Paper.�*/
rps_t�even_d�=�rps_even_d(win_d,�paper_d);
print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d);
printf("�and�");�print_rps(paper_d);�printf(".n");
/*�=>�Rock�is�even�between�Scissors�and�Paper.�*/
}
int�main()�{
rps_t�paper_d�=�P_RPS_T;
rps_t�win_d�=�rps_win_d�(paper_d);
print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n");
/*�=>�Scissors�win�Paper.�*/
rps_t�even_d�=�rps_even_d(win_d,�paper_d);
print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d);
printf("�and�");�print_rps(paper_d);�printf(".n");
/*�=>�Rock�is�even�between�Scissors�and�Paper.�*/
}
R-P-S in C language #3R-P-S in C language #3R-P-S in C language #3R-P-S in C language #3R-P-S in C language #3
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�P_RPS_T;
case�P_RPS_T:
return�S_RPS_T;
case�S_RPS_T:
return�R_RPS_T;
default:
abort();
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(x);
default:
abort();
}
}
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�P_RPS_T;
case�P_RPS_T:
return�S_RPS_T;
case�S_RPS_T:
return�R_RPS_T;
default:
abort();
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(x);
default:
abort();
}
}
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�P_RPS_T;
case�P_RPS_T:
return�S_RPS_T;
case�S_RPS_T:
return�R_RPS_T;
default:
abort();
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(x);
default:
abort();
}
}
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�P_RPS_T;
case�P_RPS_T:
return�S_RPS_T;
case�S_RPS_T:
return�R_RPS_T;
default:
abort();
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(x);
default:
abort();
}
}
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�P_RPS_T;
case�P_RPS_T:
return�S_RPS_T;
case�S_RPS_T:
return�R_RPS_T;
default:
abort();
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(x);
default:
abort();
}
}
However you can make run-time errorHowever you can make run-time errorHowever you can make run-time errorHowever you can make run-time errorHowever you can make run-time error
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�R_RPS_T;�/*�Run-time�error!�*/
case�P_RPS_T:
return�S_RPS_T;
/* case�S_RPS_T:
return�R_RPS_T;�*/�/*�Not�exhaustive!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(y);�/*�Run-time�error!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�R_RPS_T;�/*�Run-time�error!�*/
case�P_RPS_T:
return�S_RPS_T;
/* case�S_RPS_T:
return�R_RPS_T;�*/�/*�Not�exhaustive!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(y);�/*�Run-time�error!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�R_RPS_T;�/*�Run-time�error!�*/
case�P_RPS_T:
return�S_RPS_T;
/* case�S_RPS_T:
return�R_RPS_T;�*/�/*�Not�exhaustive!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(y);�/*�Run-time�error!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�R_RPS_T;�/*�Run-time�error!�*/
case�P_RPS_T:
return�S_RPS_T;
/* case�S_RPS_T:
return�R_RPS_T;�*/�/*�Not�exhaustive!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(y);�/*�Run-time�error!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
rps_t�rps_win_d(rps_t�x)�{
switch�(x)�{
case�R_RPS_T:
return�R_RPS_T;�/*�Run-time�error!�*/
case�P_RPS_T:
return�S_RPS_T;
/* case�S_RPS_T:
return�R_RPS_T;�*/ /*�Not�exhaustive!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
#define�PACK(X,Y)�((X)<<4�│�(Y))
rps_t�rps_even_d(rps_t�x,�rps_t�y)�{
switch�(PACK(x,�y))�{
case�PACK(P_RPS_T,�R_RPS_T):
case�PACK(S_RPS_T,�P_RPS_T):
case�PACK(R_RPS_T,�S_RPS_T):
return�rps_win_d(y);�/*�Run-time�error!�*/
default:
abort();�/*�Abort�occurs!�*/
}
}
Please imagine specification on codePlease imagine specification on codePlease imagine specification on codePlease imagine specification on codePlease imagine specification on code
☆ Introduce specification using static typing.☆ Introduce specification using static typing.☆ Introduce specification using static typing.☆ Introduce specification using static typing.☆ Introduce specification using static typing.
☆ You will get more compile-time errors.☆ You will get more compile-time errors.☆ You will get more compile-time errors.☆ You will get more compile-time errors.☆ You will get more compile-time errors.
☆ You will get less run-time errors.☆ You will get less run-time errors.☆ You will get less run-time errors.☆ You will get less run-time errors.☆ You will get less run-time errors.
☆ You can do that in ATS language.☆ You can do that in ATS language.☆ You can do that in ATS language.☆ You can do that in ATS language.☆ You can do that in ATS language.
ATS languageATS languageATS languageATS languageATS language
☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/
☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types
☆ Linear types☆ Linear types☆ Linear types☆ Linear types☆ Linear types
☆ Optional GC☆ Optional GC☆ Optional GC☆ Optional GC☆ Optional GC
☆ Optional malloc/free☆ Optional malloc/free☆ Optional malloc/free☆ Optional malloc/free☆ Optional malloc/free
☆ Optional run-time☆ Optional run-time☆ Optional run-time☆ Optional run-time☆ Optional run-time
More strong type can be used on the ATS.More strong type can be used on the ATS.More strong type can be used on the ATS.More strong type can be used on the ATS.More strong type can be used on the ATS.
DML-style dependent types in ATSDML-style dependent types in ATSDML-style dependent types in ATSDML-style dependent types in ATSDML-style dependent types in ATS
Type of R-P-S in ATSType of R-P-S in ATSType of R-P-S in ATSType of R-P-S in ATSType of R-P-S in ATS
datasort�rps_s�=
��│�r_rps_s�(*�Rock�*)
��│�p_rps_s�(*�Paper�*)
��│�s_rps_s�(*�Scissors�*)
datatype�rps_t�(rps_s)�=
��│�r_rps_t�(r_rps_s)�(*�Rock�*)
��│�p_rps_t�(p_rps_s)�(*�Paper�*)
��│�s_rps_t�(s_rps_s)�(*�Scissors�*)
typedef�rps_t_any�=�[x:rps_s]�rps_t�(x)
datasort�rps_s�=
��│�r_rps_s�(*�Rock�*)
��│�p_rps_s�(*�Paper�*)
��│�s_rps_s�(*�Scissors�*)
datatype�rps_t�(rps_s)�=
��│�r_rps_t�(r_rps_s)�(*�Rock�*)
��│�p_rps_t�(p_rps_s)�(*�Paper�*)
��│�s_rps_t�(s_rps_s)�(*�Scissors�*)
typedef�rps_t_any�=�[x:rps_s]�rps_t�(x)
datasort�rps_s�=
��│�r_rps_s�(*�Rock�*)
��│�p_rps_s�(*�Paper�*)
��│�s_rps_s�(*�Scissors�*)
datatype�rps_t�(rps_s)�=
��│�r_rps_t�(r_rps_s)�(*�Rock�*)
��│�p_rps_t�(p_rps_s)�(*�Paper�*)
��│�s_rps_t�(s_rps_s)�(*�Scissors�*)
typedef�rps_t_any�=�[x:rps_s]�rps_t�(x)
datasort�rps_s�=
��│�r_rps_s�(*�Rock�*)
��│�p_rps_s�(*�Paper�*)
��│�s_rps_s�(*�Scissors�*)
datatype�rps_t�(rps_s)�=
��│�r_rps_t�(r_rps_s)�(*�Rock�*)
��│�p_rps_t�(p_rps_s)�(*�Paper�*)
��│�s_rps_t�(s_rps_s)�(*�Scissors�*)
typedef�rps_t_any�=�[x:rps_s]�rps_t�(x)
datasort�rps_s�=
��│�r_rps_s�(*�Rock�*)
��│�p_rps_s�(*�Paper�*)
��│�s_rps_s�(*�Scissors�*)
datatype�rps_t�(rps_s)�=
��│�r_rps_t�(r_rps_s)�(*�Rock�*)
��│�p_rps_t�(p_rps_s)�(*�Paper�*)
��│�s_rps_t�(s_rps_s)�(*�Scissors�*)
typedef�rps_t_any�=�[x:rps_s]�rps_t�(x)
Only use Dynamics of ATSOnly use Dynamics of ATSOnly use Dynamics of ATSOnly use Dynamics of ATSOnly use Dynamics of ATS
fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any
fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win�
the�y.�*)
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")
fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any
fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win�
the�y.�*)
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")
fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any
fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win�
the�y.�*)
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")
fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any
fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win�
the�y.�*)
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")
fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any
fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win�
the�y.�*)
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")
Also you can make run-time errorAlso you can make run-time errorAlso you can make run-time errorAlso you can make run-time errorAlso you can make run-time error
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
(*│�s_rps_t()�=>�r_rps_t()�*)�(*�Compile-time�error!�*)
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception�
occurs!�*)
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
(*│�s_rps_t()�=>�r_rps_t()�*)�(*�Compile-time�error!�*)
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception�
occurs!�*)
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
(*│�s_rps_t()�=>�r_rps_t()�*)�(*�Compile-time�error!�*)
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception�
occurs!�*)
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
(*│�s_rps_t()�=>�r_rps_t()�*)�(*�Compile-time�error!�*)
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception�
occurs!�*)
implement{}�rps_win_d�(x)�=
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
(*│�s_rps_t()�=>�r_rps_t()�*) (*�Compile-time�error!�*)
implement{}�rps_even_d�(x,�y)�=
��case+�(x,�y)�of
��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x)
��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*)
��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x)
��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception�
occurs!�*)
It's caused by having no specification in the
implementation. ATS language can have
specification as Statics or Proofs.
It's caused by having no specification in the
implementation. ATS language can have
specification as Statics or Proofs.
It's caused by having no specification in the
implementation. ATS language can have
specification as Statics or Proofs.
It's caused by having no specification in the
implementation. ATS language can have
specification as Statics or Proofs.
It's caused by having no specification in the
implementation. ATS language can have
specification as Statics or Proofs.
Specification using Statics of ATSSpecification using Statics of ATSSpecification using Statics of ATSSpecification using Statics of ATSSpecification using Statics of ATS
stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool
fun{}�rps_win_s
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2))
stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool
fun{}�rps_win_s
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2))
stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool
fun{}�rps_win_s
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2))
stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool
fun{}�rps_win_s
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2))
stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool
fun{}�rps_win_s
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2))
Implementation using Statics of ATSImplementation using Statics of ATSImplementation using Statics of ATSImplementation using Statics of ATSImplementation using Statics of ATS
extern�praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*�
Spec:�Paper�wins�Rock�*)
extern�praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*�
Spec:�Scissors�win�Paper�*)
extern�praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*�
Spec:�Rock�wins�Scissors�*)
implement{}�rps_win_s�(x)�=�let
��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
��prval�()�=�rps_win_p_r_pf()
��prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
extern�praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*�
Spec:�Paper�wins�Rock�*)
extern�praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*�
Spec:�Scissors�win�Paper�*)
extern�praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*�
Spec:�Rock�wins�Scissors�*)
implement{}�rps_win_s�(x)�=�let
��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
��prval�()�=�rps_win_p_r_pf()
��prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
extern�praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*�
Spec:�Paper�wins�Rock�*)
extern�praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*�
Spec:�Scissors�win�Paper�*)
extern�praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*�
Spec:�Rock�wins�Scissors�*)
implement{}�rps_win_s�(x)�=�let
��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
��prval�()�=�rps_win_p_r_pf()
��prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
extern�praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*�
Spec:�Paper�wins�Rock�*)
extern�praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*�
Spec:�Scissors�win�Paper�*)
extern�praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*�
Spec:�Rock�wins�Scissors�*)
implement{}�rps_win_s�(x)�=�let
��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
��prval�()�=�rps_win_p_r_pf()
��prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
extern praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*�
Spec:�Paper�wins�Rock�*)
extern praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*�
Spec:�Scissors�win�Paper�*)
extern praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*�
Spec:�Rock�wins�Scissors�*)
implement{}�rps_win_s�(x)�=�let
prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
prval�()�=�rps_win_p_r_pf()
prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�p_rps_t()
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
Statics can catch error at compile-timeStatics can catch error at compile-timeStatics can catch error at compile-timeStatics can catch error at compile-timeStatics can catch error at compile-time
implement{}�rps_win_s�(x)�=�let
��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
��prval�()�=�rps_win_p_r_pf()
��prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
implement{}�rps_win_s�(x)�=�let
��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
��prval�()�=�rps_win_p_r_pf()
��prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
implement{}�rps_win_s�(x)�=�let
��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
��prval�()�=�rps_win_p_r_pf()
��prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
implement{}�rps_win_s�(x)�=�let
��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
��prval�()�=�rps_win_p_r_pf()
��prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
implement{}�rps_win_s�(x)�=�let
prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*)
prval�()�=�rps_win_p_r_pf()
prval�()�=�rps_win_s_p_pf()
in
��case+�x�of
��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�s_rps_t()
��│�s_rps_t()�=>�r_rps_t()
end
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--�
942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();�
S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar
(r1$2870(7929))))
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--�
942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();�
S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar
(r1$2870(7929))))
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--�
942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();�
S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar
(r1$2870(7929))))
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--�
942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();�
S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar
(r1$2870(7929))))
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--�
942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();�
S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar
(r1$2870(7929))))
Specification using Proofs of ATSSpecification using Proofs of ATSSpecification using Proofs of ATSSpecification using Proofs of ATSSpecification using Proofs of ATS
dataprop�RPS_WIN�(rps_s,�rps_s)�=
��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*)
��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*)
��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*)
fun{}�rps_win_p
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2))
dataprop�RPS_WIN�(rps_s,�rps_s)�=
��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*)
��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*)
��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*)
fun{}�rps_win_p
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2))
dataprop�RPS_WIN�(rps_s,�rps_s)�=
��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*)
��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*)
��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*)
fun{}�rps_win_p
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2))
dataprop�RPS_WIN�(rps_s,�rps_s)�=
��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*)
��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*)
��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*)
fun{}�rps_win_p
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2))
dataprop�RPS_WIN�(rps_s,�rps_s)�=
��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*)
��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*)
��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*)
fun{}�rps_win_p
��{r1:rps_s}�(x:�rps_t�(r1)):
��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2))
Implementation using Proofs of ATSImplementation using Proofs of ATSImplementation using Proofs of ATSImplementation using Proofs of ATSImplementation using Proofs of ATS
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t())
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t())
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t())
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t())
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t())
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
Proofs can catch error at compile-timeProofs can catch error at compile-timeProofs can catch error at compile-timeProofs can catch error at compile-timeProofs can catch error at compile-time
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
implement{}�rps_win_p�(x)�=�case+�x�of
��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*)
��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t())
��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--�
1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned�
the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst
(RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst
(rps_t);�S2Evar(r2$2876(7935)))))].
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--�
1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned�
the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst
(RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst
(rps_t);�S2Evar(r2$2876(7935)))))].
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--�
1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned�
the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst
(RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst
(rps_t);�S2Evar(r2$2876(7935)))))].
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--�
1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned�
the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst
(RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst
(rps_t);�S2Evar(r2$2876(7935)))))].
$�patscc�main.dats�-DATS_MEMALLOC_LIBC
/home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--�
1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned�
the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst
(RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst
(rps_t);�S2Evar(r2$2876(7935)))))].
The code is found at GitHubThe code is found at GitHubThe code is found at GitHubThe code is found at GitHubThe code is found at GitHub
https://github.com/jats-ug/practice-ats/tree/master/static_rpshttps://github.com/jats-ug/practice-ats/tree/master/static_rpshttps://github.com/jats-ug/practice-ats/tree/master/static_rpshttps://github.com/jats-ug/practice-ats/tree/master/static_rpshttps://github.com/jats-ug/practice-ats/tree/master/static_rps
License of photosLicense of photosLicense of photosLicense of photosLicense of photos
*�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"�
interact.
��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper-
scissors.svg
��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0
*�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/zombiesquirrels/3477986919/
��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0
*�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:�
Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/31029865@N06/15018892358/
��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0
*�Cuddle�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/peptravassos/14206994372/
��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0
*�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/stevelacey/5820920545/
��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0
*�Imagine�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/tonythemisfit/4773974792/
��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0
*�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/steren/2732488224/
��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0
*�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"�
interact.
��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper-
scissors.svg
��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0
*�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/zombiesquirrels/3477986919/
��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0
*�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:�
Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/31029865@N06/15018892358/
��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0
*�Cuddle�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/peptravassos/14206994372/
��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0
*�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/stevelacey/5820920545/
��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0
*�Imagine�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/tonythemisfit/4773974792/
��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0
*�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/steren/2732488224/
��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0
*�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"�
interact.
��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper-
scissors.svg
��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0
*�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/zombiesquirrels/3477986919/
��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0
*�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:�
Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/31029865@N06/15018892358/
��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0
*�Cuddle�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/peptravassos/14206994372/
��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0
*�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/stevelacey/5820920545/
��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0
*�Imagine�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/tonythemisfit/4773974792/
��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0
*�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/steren/2732488224/
��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0
*�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"�
interact.
��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper-
scissors.svg
��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0
*�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/zombiesquirrels/3477986919/
��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0
*�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:�
Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/31029865@N06/15018892358/
��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0
*�Cuddle�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/peptravassos/14206994372/
��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0
*�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/stevelacey/5820920545/
��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0
*�Imagine�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/tonythemisfit/4773974792/
��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0
*�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/steren/2732488224/
��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0
*�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"�
interact.
��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper-
scissors.svg
��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0
*�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/zombiesquirrels/3477986919/
��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0
*�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:�
Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/31029865@N06/15018892358/
��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0
*�Cuddle�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/peptravassos/14206994372/
��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0
*�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/stevelacey/5820920545/
��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0
*�Imagine�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/tonythemisfit/4773974792/
��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0
*�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing!
��https://www.flickr.com/photos/steren/2732488224/
��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0

More Related Content

What's hot

Start! ATS programming
Start! ATS programmingStart! ATS programming
Start! ATS programmingKiwamu Okabe
 
ATS/LF for Coq users
ATS/LF for Coq usersATS/LF for Coq users
ATS/LF for Coq usersKiwamu Okabe
 
Metasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCUMetasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCUKiwamu Okabe
 
Metasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on ArduinoMetasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on ArduinoKiwamu Okabe
 
Hands-on VeriFast with STM32 microcontroller
Hands-on VeriFast with STM32 microcontrollerHands-on VeriFast with STM32 microcontroller
Hands-on VeriFast with STM32 microcontrollerKiwamu Okabe
 
Functional IoT: Introduction
Functional IoT: IntroductionFunctional IoT: Introduction
Functional IoT: IntroductionKiwamu Okabe
 
Functional IoT: Hardware and Platform
Functional IoT: Hardware and PlatformFunctional IoT: Hardware and Platform
Functional IoT: Hardware and PlatformKiwamu Okabe
 
Metasepi team meeting #17: Invariant captured by ATS's API
Metasepi team meeting #17: Invariant captured by ATS's APIMetasepi team meeting #17: Invariant captured by ATS's API
Metasepi team meeting #17: Invariant captured by ATS's APIKiwamu Okabe
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATSKiwamu Okabe
 
Past and today of Metasepi project
Past and today of Metasepi projectPast and today of Metasepi project
Past and today of Metasepi projectKiwamu Okabe
 
2009 Eclipse Con
2009 Eclipse Con2009 Eclipse Con
2009 Eclipse Conguest29922
 
Ajhc Haskell Compiler with Reentrant GC
Ajhc Haskell Compiler with Reentrant GCAjhc Haskell Compiler with Reentrant GC
Ajhc Haskell Compiler with Reentrant GCKiwamu Okabe
 
Let's contribute, HTML5Rocks/ko!
Let's contribute, HTML5Rocks/ko!Let's contribute, HTML5Rocks/ko!
Let's contribute, HTML5Rocks/ko!Chang W. Doh
 
Spring, CDI, Jakarta EE good parts
Spring, CDI, Jakarta EE good partsSpring, CDI, Jakarta EE good parts
Spring, CDI, Jakarta EE good partsJarek Ratajski
 
"Black Clouds and Silver Linings in Node.js Security" Liran Tal
"Black Clouds and Silver Linings in Node.js Security" Liran Tal"Black Clouds and Silver Linings in Node.js Security" Liran Tal
"Black Clouds and Silver Linings in Node.js Security" Liran TalJulia Cherniak
 
JavaScript Speech Recognition
JavaScript Speech RecognitionJavaScript Speech Recognition
JavaScript Speech RecognitionFITC
 
Monkey-patching in Python: a magic trick or a powerful tool?
Monkey-patching in Python: a magic trick or a powerful tool?Monkey-patching in Python: a magic trick or a powerful tool?
Monkey-patching in Python: a magic trick or a powerful tool?Elizaveta Shashkova
 
Use Groovy&Grails in your spring boot projects
Use Groovy&Grails in your spring boot projectsUse Groovy&Grails in your spring boot projects
Use Groovy&Grails in your spring boot projectsParadigma Digital
 
Gareth Rushgrove (Puppet) - Ubiquity at #DOXLON
Gareth Rushgrove (Puppet) - Ubiquity at #DOXLONGareth Rushgrove (Puppet) - Ubiquity at #DOXLON
Gareth Rushgrove (Puppet) - Ubiquity at #DOXLONOutlyer
 

What's hot (20)

Start! ATS programming
Start! ATS programmingStart! ATS programming
Start! ATS programming
 
ATS2 updates 2017
ATS2 updates 2017ATS2 updates 2017
ATS2 updates 2017
 
ATS/LF for Coq users
ATS/LF for Coq usersATS/LF for Coq users
ATS/LF for Coq users
 
Metasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCUMetasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCU
 
Metasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on ArduinoMetasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on Arduino
 
Hands-on VeriFast with STM32 microcontroller
Hands-on VeriFast with STM32 microcontrollerHands-on VeriFast with STM32 microcontroller
Hands-on VeriFast with STM32 microcontroller
 
Functional IoT: Introduction
Functional IoT: IntroductionFunctional IoT: Introduction
Functional IoT: Introduction
 
Functional IoT: Hardware and Platform
Functional IoT: Hardware and PlatformFunctional IoT: Hardware and Platform
Functional IoT: Hardware and Platform
 
Metasepi team meeting #17: Invariant captured by ATS's API
Metasepi team meeting #17: Invariant captured by ATS's APIMetasepi team meeting #17: Invariant captured by ATS's API
Metasepi team meeting #17: Invariant captured by ATS's API
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
 
Past and today of Metasepi project
Past and today of Metasepi projectPast and today of Metasepi project
Past and today of Metasepi project
 
2009 Eclipse Con
2009 Eclipse Con2009 Eclipse Con
2009 Eclipse Con
 
Ajhc Haskell Compiler with Reentrant GC
Ajhc Haskell Compiler with Reentrant GCAjhc Haskell Compiler with Reentrant GC
Ajhc Haskell Compiler with Reentrant GC
 
Let's contribute, HTML5Rocks/ko!
Let's contribute, HTML5Rocks/ko!Let's contribute, HTML5Rocks/ko!
Let's contribute, HTML5Rocks/ko!
 
Spring, CDI, Jakarta EE good parts
Spring, CDI, Jakarta EE good partsSpring, CDI, Jakarta EE good parts
Spring, CDI, Jakarta EE good parts
 
"Black Clouds and Silver Linings in Node.js Security" Liran Tal
"Black Clouds and Silver Linings in Node.js Security" Liran Tal"Black Clouds and Silver Linings in Node.js Security" Liran Tal
"Black Clouds and Silver Linings in Node.js Security" Liran Tal
 
JavaScript Speech Recognition
JavaScript Speech RecognitionJavaScript Speech Recognition
JavaScript Speech Recognition
 
Monkey-patching in Python: a magic trick or a powerful tool?
Monkey-patching in Python: a magic trick or a powerful tool?Monkey-patching in Python: a magic trick or a powerful tool?
Monkey-patching in Python: a magic trick or a powerful tool?
 
Use Groovy&Grails in your spring boot projects
Use Groovy&Grails in your spring boot projectsUse Groovy&Grails in your spring boot projects
Use Groovy&Grails in your spring boot projects
 
Gareth Rushgrove (Puppet) - Ubiquity at #DOXLON
Gareth Rushgrove (Puppet) - Ubiquity at #DOXLONGareth Rushgrove (Puppet) - Ubiquity at #DOXLON
Gareth Rushgrove (Puppet) - Ubiquity at #DOXLON
 

Viewers also liked

デザイナーでも構築できる多言語/マルチデバイス対応サイト
デザイナーでも構築できる多言語/マルチデバイス対応サイトデザイナーでも構築できる多言語/マルチデバイス対応サイト
デザイナーでも構築できる多言語/マルチデバイス対応サイトAtushi Sugiyama
 
東海道らぐへのお誘い 2015年版
東海道らぐへのお誘い 2015年版東海道らぐへのお誘い 2015年版
東海道らぐへのお誘い 2015年版shimadah
 
【KSKアナリティクス】 RapidMiner 紹介 (short)
【KSKアナリティクス】 RapidMiner 紹介 (short)【KSKアナリティクス】 RapidMiner 紹介 (short)
【KSKアナリティクス】 RapidMiner 紹介 (short)KSK Analytics Inc.
 
Raspberry pi + piface=home electronics-security
Raspberry pi + piface=home electronics-securityRaspberry pi + piface=home electronics-security
Raspberry pi + piface=home electronics-securityYamauchi isamu
 
【KSKアナリティクス】会社案内・事例紹介
【KSKアナリティクス】会社案内・事例紹介【KSKアナリティクス】会社案内・事例紹介
【KSKアナリティクス】会社案内・事例紹介KSK Analytics Inc.
 
【KSKアナリティクス】製品・サービス案内
【KSKアナリティクス】製品・サービス案内【KSKアナリティクス】製品・サービス案内
【KSKアナリティクス】製品・サービス案内KSK Analytics Inc.
 
オープンデータプラグイン紹介資料
オープンデータプラグイン紹介資料オープンデータプラグイン紹介資料
オープンデータプラグイン紹介資料Naokazu Nohara
 
【KSKアナリティクス】Pentaho紹介
【KSKアナリティクス】Pentaho紹介【KSKアナリティクス】Pentaho紹介
【KSKアナリティクス】Pentaho紹介KSK Analytics Inc.
 
LibreOfficeの最新動向 in KOF2015
LibreOfficeの最新動向 in KOF2015LibreOfficeの最新動向 in KOF2015
LibreOfficeの最新動向 in KOF2015Shinji Enoki
 
魁ここんとーく in おおさか
魁ここんとーく in おおさか魁ここんとーく in おおさか
魁ここんとーく in おおさかshimadah
 
kintoneの大規模フロントエンド開発とツール
kintoneの大規模フロントエンド開発とツールkintoneの大規模フロントエンド開発とツール
kintoneの大規模フロントエンド開発とツールYasuharu Sakai
 

Viewers also liked (11)

デザイナーでも構築できる多言語/マルチデバイス対応サイト
デザイナーでも構築できる多言語/マルチデバイス対応サイトデザイナーでも構築できる多言語/マルチデバイス対応サイト
デザイナーでも構築できる多言語/マルチデバイス対応サイト
 
東海道らぐへのお誘い 2015年版
東海道らぐへのお誘い 2015年版東海道らぐへのお誘い 2015年版
東海道らぐへのお誘い 2015年版
 
【KSKアナリティクス】 RapidMiner 紹介 (short)
【KSKアナリティクス】 RapidMiner 紹介 (short)【KSKアナリティクス】 RapidMiner 紹介 (short)
【KSKアナリティクス】 RapidMiner 紹介 (short)
 
Raspberry pi + piface=home electronics-security
Raspberry pi + piface=home electronics-securityRaspberry pi + piface=home electronics-security
Raspberry pi + piface=home electronics-security
 
【KSKアナリティクス】会社案内・事例紹介
【KSKアナリティクス】会社案内・事例紹介【KSKアナリティクス】会社案内・事例紹介
【KSKアナリティクス】会社案内・事例紹介
 
【KSKアナリティクス】製品・サービス案内
【KSKアナリティクス】製品・サービス案内【KSKアナリティクス】製品・サービス案内
【KSKアナリティクス】製品・サービス案内
 
オープンデータプラグイン紹介資料
オープンデータプラグイン紹介資料オープンデータプラグイン紹介資料
オープンデータプラグイン紹介資料
 
【KSKアナリティクス】Pentaho紹介
【KSKアナリティクス】Pentaho紹介【KSKアナリティクス】Pentaho紹介
【KSKアナリティクス】Pentaho紹介
 
LibreOfficeの最新動向 in KOF2015
LibreOfficeの最新動向 in KOF2015LibreOfficeの最新動向 in KOF2015
LibreOfficeの最新動向 in KOF2015
 
魁ここんとーく in おおさか
魁ここんとーく in おおさか魁ここんとーく in おおさか
魁ここんとーく in おおさか
 
kintoneの大規模フロントエンド開発とツール
kintoneの大規模フロントエンド開発とツールkintoneの大規模フロントエンド開発とツール
kintoneの大規模フロントエンド開発とツール
 

Similar to Static typing and proof in ATS language

Poster: Generate ATS interface from C code, and introduce linear type
Poster: Generate ATS interface from C code, and introduce linear typePoster: Generate ATS interface from C code, and introduce linear type
Poster: Generate ATS interface from C code, and introduce linear typeKiwamu Okabe
 
Poster: Comparing ATS and VeriFast on RTOS system state
Poster: Comparing ATS and VeriFast on RTOS system statePoster: Comparing ATS and VeriFast on RTOS system state
Poster: Comparing ATS and VeriFast on RTOS system stateKiwamu Okabe
 
Understanding Names with Neural Networks - May 2020
Understanding Names with Neural Networks - May 2020Understanding Names with Neural Networks - May 2020
Understanding Names with Neural Networks - May 2020Basis Technology
 
Å bytte hjul på et tog i fart: Hvordan implementere et designsystem i praksis...
Å bytte hjul på et tog i fart: Hvordan implementere et designsystem i praksis...Å bytte hjul på et tog i fart: Hvordan implementere et designsystem i praksis...
Å bytte hjul på et tog i fart: Hvordan implementere et designsystem i praksis...Yggdrasilkonferansen
 
Embed--Basic PERL XS
Embed--Basic PERL XSEmbed--Basic PERL XS
Embed--Basic PERL XSbyterock
 
OSDcLang On Mobile Devices
OSDcLang On Mobile DevicesOSDcLang On Mobile Devices
OSDcLang On Mobile DevicesJonathan Oxer
 
Natural Language Processing made easy
Natural Language Processing made easyNatural Language Processing made easy
Natural Language Processing made easyGopi Krishnan Nambiar
 
NLTK: Natural Language Processing made easy
NLTK: Natural Language Processing made easyNLTK: Natural Language Processing made easy
NLTK: Natural Language Processing made easyoutsider2
 
Does Infer dream of design by contract?
Does Infer dream of design by contract?Does Infer dream of design by contract?
Does Infer dream of design by contract?Kiwamu Okabe
 

Similar to Static typing and proof in ATS language (13)

Poster: Generate ATS interface from C code, and introduce linear type
Poster: Generate ATS interface from C code, and introduce linear typePoster: Generate ATS interface from C code, and introduce linear type
Poster: Generate ATS interface from C code, and introduce linear type
 
Poster: Comparing ATS and VeriFast on RTOS system state
Poster: Comparing ATS and VeriFast on RTOS system statePoster: Comparing ATS and VeriFast on RTOS system state
Poster: Comparing ATS and VeriFast on RTOS system state
 
gonzalo
gonzalogonzalo
gonzalo
 
I35s
I35sI35s
I35s
 
Understanding Names with Neural Networks - May 2020
Understanding Names with Neural Networks - May 2020Understanding Names with Neural Networks - May 2020
Understanding Names with Neural Networks - May 2020
 
Å bytte hjul på et tog i fart: Hvordan implementere et designsystem i praksis...
Å bytte hjul på et tog i fart: Hvordan implementere et designsystem i praksis...Å bytte hjul på et tog i fart: Hvordan implementere et designsystem i praksis...
Å bytte hjul på et tog i fart: Hvordan implementere et designsystem i praksis...
 
Embed--Basic PERL XS
Embed--Basic PERL XSEmbed--Basic PERL XS
Embed--Basic PERL XS
 
OSDcLang On Mobile Devices
OSDcLang On Mobile DevicesOSDcLang On Mobile Devices
OSDcLang On Mobile Devices
 
Natural Language Processing made easy
Natural Language Processing made easyNatural Language Processing made easy
Natural Language Processing made easy
 
NLTK: Natural Language Processing made easy
NLTK: Natural Language Processing made easyNLTK: Natural Language Processing made easy
NLTK: Natural Language Processing made easy
 
Does Infer dream of design by contract?
Does Infer dream of design by contract?Does Infer dream of design by contract?
Does Infer dream of design by contract?
 
Why Scala?
Why Scala?Why Scala?
Why Scala?
 
Learning Ruby
Learning RubyLearning Ruby
Learning Ruby
 

Recently uploaded

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 

Recently uploaded (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 

Static typing and proof in ATS language

  • 1. Static typing and proof in ATS language Static typing and proof in ATS language Static typing and proof in ATS language Static typing and proof in ATS language Static typing and proof in ATS language Kiwamu OkabeKiwamu OkabeKiwamu OkabeKiwamu OkabeKiwamu Okabe
  • 2. Let's make Rock-paper-scissors libraryLet's make Rock-paper-scissors libraryLet's make Rock-paper-scissors libraryLet's make Rock-paper-scissors libraryLet's make Rock-paper-scissors library ☆ �じゃんけん� in Japanese.☆ �じゃんけん� in Japanese.☆ �じゃんけん� in Japanese.☆ �じゃんけん� in Japanese.☆ �じゃんけん� in Japanese.
  • 3. R-P-S in C language #1R-P-S in C language #1R-P-S in C language #1R-P-S in C language #1R-P-S in C language #1 #include�<stdio.h> #include�<stdlib.h> typedef�enum�{ R_RPS_T�=�0,�/*�Rock�*/ P_RPS_T,�����/*�Paper�*/ S_RPS_T������/*�Scissors�*/ }�rps_t; void�print_rps(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: printf("Rock");�break; case�P_RPS_T: printf("Paper");�break; case�S_RPS_T: printf("Scissors");�break; } } #include�<stdio.h> #include�<stdlib.h> typedef�enum�{ R_RPS_T�=�0,�/*�Rock�*/ P_RPS_T,�����/*�Paper�*/ S_RPS_T������/*�Scissors�*/ }�rps_t; void�print_rps(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: printf("Rock");�break; case�P_RPS_T: printf("Paper");�break; case�S_RPS_T: printf("Scissors");�break; } } #include�<stdio.h> #include�<stdlib.h> typedef�enum�{ R_RPS_T�=�0,�/*�Rock�*/ P_RPS_T,�����/*�Paper�*/ S_RPS_T������/*�Scissors�*/ }�rps_t; void�print_rps(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: printf("Rock");�break; case�P_RPS_T: printf("Paper");�break; case�S_RPS_T: printf("Scissors");�break; } } #include�<stdio.h> #include�<stdlib.h> typedef�enum�{ R_RPS_T�=�0,�/*�Rock�*/ P_RPS_T,�����/*�Paper�*/ S_RPS_T������/*�Scissors�*/ }�rps_t; void�print_rps(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: printf("Rock");�break; case�P_RPS_T: printf("Paper");�break; case�S_RPS_T: printf("Scissors");�break; } } #include�<stdio.h> #include�<stdlib.h> typedef enum�{ R_RPS_T�=�0,�/*�Rock�*/ P_RPS_T,�����/*�Paper�*/ S_RPS_T������/*�Scissors�*/ }�rps_t; void�print_rps(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: printf("Rock");�break; case�P_RPS_T: printf("Paper");�break; case�S_RPS_T: printf("Scissors");�break; } }
  • 4. R-P-S in C language #2R-P-S in C language #2R-P-S in C language #2R-P-S in C language #2R-P-S in C language #2 int�main()�{ rps_t�paper_d�=�P_RPS_T; rps_t�win_d�=�rps_win_d�(paper_d); print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n"); /*�=>�Scissors�win�Paper.�*/ rps_t�even_d�=�rps_even_d(win_d,�paper_d); print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d); printf("�and�");�print_rps(paper_d);�printf(".n"); /*�=>�Rock�is�even�between�Scissors�and�Paper.�*/ } int�main()�{ rps_t�paper_d�=�P_RPS_T; rps_t�win_d�=�rps_win_d�(paper_d); print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n"); /*�=>�Scissors�win�Paper.�*/ rps_t�even_d�=�rps_even_d(win_d,�paper_d); print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d); printf("�and�");�print_rps(paper_d);�printf(".n"); /*�=>�Rock�is�even�between�Scissors�and�Paper.�*/ } int�main()�{ rps_t�paper_d�=�P_RPS_T; rps_t�win_d�=�rps_win_d�(paper_d); print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n"); /*�=>�Scissors�win�Paper.�*/ rps_t�even_d�=�rps_even_d(win_d,�paper_d); print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d); printf("�and�");�print_rps(paper_d);�printf(".n"); /*�=>�Rock�is�even�between�Scissors�and�Paper.�*/ } int�main()�{ rps_t�paper_d�=�P_RPS_T; rps_t�win_d�=�rps_win_d�(paper_d); print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n"); /*�=>�Scissors�win�Paper.�*/ rps_t�even_d�=�rps_even_d(win_d,�paper_d); print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d); printf("�and�");�print_rps(paper_d);�printf(".n"); /*�=>�Rock�is�even�between�Scissors�and�Paper.�*/ } int�main()�{ rps_t�paper_d�=�P_RPS_T; rps_t�win_d�=�rps_win_d�(paper_d); print_rps(win_d);�printf("�win�");�print_rps(paper_d);�printf(".n"); /*�=>�Scissors�win�Paper.�*/ rps_t�even_d�=�rps_even_d(win_d,�paper_d); print_rps(even_d);�printf("�is�even�between�");�print_rps(win_d); printf("�and�");�print_rps(paper_d);�printf(".n"); /*�=>�Rock�is�even�between�Scissors�and�Paper.�*/ }
  • 5. R-P-S in C language #3R-P-S in C language #3R-P-S in C language #3R-P-S in C language #3R-P-S in C language #3 rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�P_RPS_T; case�P_RPS_T: return�S_RPS_T; case�S_RPS_T: return�R_RPS_T; default: abort(); } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(x); default: abort(); } } rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�P_RPS_T; case�P_RPS_T: return�S_RPS_T; case�S_RPS_T: return�R_RPS_T; default: abort(); } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(x); default: abort(); } } rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�P_RPS_T; case�P_RPS_T: return�S_RPS_T; case�S_RPS_T: return�R_RPS_T; default: abort(); } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(x); default: abort(); } } rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�P_RPS_T; case�P_RPS_T: return�S_RPS_T; case�S_RPS_T: return�R_RPS_T; default: abort(); } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(x); default: abort(); } } rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�P_RPS_T; case�P_RPS_T: return�S_RPS_T; case�S_RPS_T: return�R_RPS_T; default: abort(); } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(x); default: abort(); } }
  • 6. However you can make run-time errorHowever you can make run-time errorHowever you can make run-time errorHowever you can make run-time errorHowever you can make run-time error rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�R_RPS_T;�/*�Run-time�error!�*/ case�P_RPS_T: return�S_RPS_T; /* case�S_RPS_T: return�R_RPS_T;�*/�/*�Not�exhaustive!�*/ default: abort();�/*�Abort�occurs!�*/ } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(y);�/*�Run-time�error!�*/ default: abort();�/*�Abort�occurs!�*/ } } rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�R_RPS_T;�/*�Run-time�error!�*/ case�P_RPS_T: return�S_RPS_T; /* case�S_RPS_T: return�R_RPS_T;�*/�/*�Not�exhaustive!�*/ default: abort();�/*�Abort�occurs!�*/ } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(y);�/*�Run-time�error!�*/ default: abort();�/*�Abort�occurs!�*/ } } rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�R_RPS_T;�/*�Run-time�error!�*/ case�P_RPS_T: return�S_RPS_T; /* case�S_RPS_T: return�R_RPS_T;�*/�/*�Not�exhaustive!�*/ default: abort();�/*�Abort�occurs!�*/ } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(y);�/*�Run-time�error!�*/ default: abort();�/*�Abort�occurs!�*/ } } rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�R_RPS_T;�/*�Run-time�error!�*/ case�P_RPS_T: return�S_RPS_T; /* case�S_RPS_T: return�R_RPS_T;�*/�/*�Not�exhaustive!�*/ default: abort();�/*�Abort�occurs!�*/ } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(y);�/*�Run-time�error!�*/ default: abort();�/*�Abort�occurs!�*/ } } rps_t�rps_win_d(rps_t�x)�{ switch�(x)�{ case�R_RPS_T: return�R_RPS_T;�/*�Run-time�error!�*/ case�P_RPS_T: return�S_RPS_T; /* case�S_RPS_T: return�R_RPS_T;�*/ /*�Not�exhaustive!�*/ default: abort();�/*�Abort�occurs!�*/ } } #define�PACK(X,Y)�((X)<<4�│�(Y)) rps_t�rps_even_d(rps_t�x,�rps_t�y)�{ switch�(PACK(x,�y))�{ case�PACK(P_RPS_T,�R_RPS_T): case�PACK(S_RPS_T,�P_RPS_T): case�PACK(R_RPS_T,�S_RPS_T): return�rps_win_d(y);�/*�Run-time�error!�*/ default: abort();�/*�Abort�occurs!�*/ } }
  • 7. Please imagine specification on codePlease imagine specification on codePlease imagine specification on codePlease imagine specification on codePlease imagine specification on code ☆ Introduce specification using static typing.☆ Introduce specification using static typing.☆ Introduce specification using static typing.☆ Introduce specification using static typing.☆ Introduce specification using static typing. ☆ You will get more compile-time errors.☆ You will get more compile-time errors.☆ You will get more compile-time errors.☆ You will get more compile-time errors.☆ You will get more compile-time errors. ☆ You will get less run-time errors.☆ You will get less run-time errors.☆ You will get less run-time errors.☆ You will get less run-time errors.☆ You will get less run-time errors. ☆ You can do that in ATS language.☆ You can do that in ATS language.☆ You can do that in ATS language.☆ You can do that in ATS language.☆ You can do that in ATS language.
  • 8. ATS languageATS languageATS languageATS languageATS language ☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/ ☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types ☆ Linear types☆ Linear types☆ Linear types☆ Linear types☆ Linear types ☆ Optional GC☆ Optional GC☆ Optional GC☆ Optional GC☆ Optional GC ☆ Optional malloc/free☆ Optional malloc/free☆ Optional malloc/free☆ Optional malloc/free☆ Optional malloc/free ☆ Optional run-time☆ Optional run-time☆ Optional run-time☆ Optional run-time☆ Optional run-time More strong type can be used on the ATS.More strong type can be used on the ATS.More strong type can be used on the ATS.More strong type can be used on the ATS.More strong type can be used on the ATS.
  • 9. DML-style dependent types in ATSDML-style dependent types in ATSDML-style dependent types in ATSDML-style dependent types in ATSDML-style dependent types in ATS
  • 10. Type of R-P-S in ATSType of R-P-S in ATSType of R-P-S in ATSType of R-P-S in ATSType of R-P-S in ATS datasort�rps_s�= ��│�r_rps_s�(*�Rock�*) ��│�p_rps_s�(*�Paper�*) ��│�s_rps_s�(*�Scissors�*) datatype�rps_t�(rps_s)�= ��│�r_rps_t�(r_rps_s)�(*�Rock�*) ��│�p_rps_t�(p_rps_s)�(*�Paper�*) ��│�s_rps_t�(s_rps_s)�(*�Scissors�*) typedef�rps_t_any�=�[x:rps_s]�rps_t�(x) datasort�rps_s�= ��│�r_rps_s�(*�Rock�*) ��│�p_rps_s�(*�Paper�*) ��│�s_rps_s�(*�Scissors�*) datatype�rps_t�(rps_s)�= ��│�r_rps_t�(r_rps_s)�(*�Rock�*) ��│�p_rps_t�(p_rps_s)�(*�Paper�*) ��│�s_rps_t�(s_rps_s)�(*�Scissors�*) typedef�rps_t_any�=�[x:rps_s]�rps_t�(x) datasort�rps_s�= ��│�r_rps_s�(*�Rock�*) ��│�p_rps_s�(*�Paper�*) ��│�s_rps_s�(*�Scissors�*) datatype�rps_t�(rps_s)�= ��│�r_rps_t�(r_rps_s)�(*�Rock�*) ��│�p_rps_t�(p_rps_s)�(*�Paper�*) ��│�s_rps_t�(s_rps_s)�(*�Scissors�*) typedef�rps_t_any�=�[x:rps_s]�rps_t�(x) datasort�rps_s�= ��│�r_rps_s�(*�Rock�*) ��│�p_rps_s�(*�Paper�*) ��│�s_rps_s�(*�Scissors�*) datatype�rps_t�(rps_s)�= ��│�r_rps_t�(r_rps_s)�(*�Rock�*) ��│�p_rps_t�(p_rps_s)�(*�Paper�*) ��│�s_rps_t�(s_rps_s)�(*�Scissors�*) typedef�rps_t_any�=�[x:rps_s]�rps_t�(x) datasort�rps_s�= ��│�r_rps_s�(*�Rock�*) ��│�p_rps_s�(*�Paper�*) ��│�s_rps_s�(*�Scissors�*) datatype�rps_t�(rps_s)�= ��│�r_rps_t�(r_rps_s)�(*�Rock�*) ��│�p_rps_t�(p_rps_s)�(*�Paper�*) ��│�s_rps_t�(s_rps_s)�(*�Scissors�*) typedef�rps_t_any�=�[x:rps_s]�rps_t�(x)
  • 11. Only use Dynamics of ATSOnly use Dynamics of ATSOnly use Dynamics of ATSOnly use Dynamics of ATSOnly use Dynamics of ATS fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win� the�y.�*) implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.") fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win� the�y.�*) implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.") fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win� the�y.�*) implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.") fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win� the�y.�*) implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.") fun{}�rps_win_d�(x:�rps_t_any):�rps_t_any fun{}�rps_even_d�(x:�rps_t_any,�y:�rps_t_any):�rps_t_any�(*�The�x�should�win� the�y.�*) implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(x) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")
  • 12. Also you can make run-time errorAlso you can make run-time errorAlso you can make run-time errorAlso you can make run-time errorAlso you can make run-time error implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() (*│�s_rps_t()�=>�r_rps_t()�*)�(*�Compile-time�error!�*) implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception� occurs!�*) implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() (*│�s_rps_t()�=>�r_rps_t()�*)�(*�Compile-time�error!�*) implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception� occurs!�*) implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() (*│�s_rps_t()�=>�r_rps_t()�*)�(*�Compile-time�error!�*) implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception� occurs!�*) implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() (*│�s_rps_t()�=>�r_rps_t()�*)�(*�Compile-time�error!�*) implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception� occurs!�*) implement{}�rps_win_d�(x)�= ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Run-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() (*│�s_rps_t()�=>�r_rps_t()�*) (*�Compile-time�error!�*) implement{}�rps_even_d�(x,�y)�= ��case+�(x,�y)�of ��│�(p_rps_t(),�r_rps_t())�=>�rps_win_d�(x) ��│�(s_rps_t(),�p_rps_t())�=>�rps_win_d�(y)�(*�Run-time�error!�*) ��│�(r_rps_t(),�s_rps_t())�=>�rps_win_d�(x) ��│�(_,�_)�=>�$raise�GenerallyExn("The�x�should�win�the�y.")�(*�Exception� occurs!�*) It's caused by having no specification in the implementation. ATS language can have specification as Statics or Proofs. It's caused by having no specification in the implementation. ATS language can have specification as Statics or Proofs. It's caused by having no specification in the implementation. ATS language can have specification as Statics or Proofs. It's caused by having no specification in the implementation. ATS language can have specification as Statics or Proofs. It's caused by having no specification in the implementation. ATS language can have specification as Statics or Proofs.
  • 13. Specification using Statics of ATSSpecification using Statics of ATSSpecification using Statics of ATSSpecification using Statics of ATSSpecification using Statics of ATS stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool fun{}�rps_win_s ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2)) stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool fun{}�rps_win_s ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2)) stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool fun{}�rps_win_s ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2)) stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool fun{}�rps_win_s ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2)) stacst�rps_win_sta:�(rps_s,�rps_s)�->�bool fun{}�rps_win_s ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s�│�rps_win_sta�(r2,�r1)]�(rps_t�(r2))
  • 14. Implementation using Statics of ATSImplementation using Statics of ATSImplementation using Statics of ATSImplementation using Statics of ATSImplementation using Statics of ATS extern�praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*� Spec:�Paper�wins�Rock�*) extern�praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*� Spec:�Scissors�win�Paper�*) extern�praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*� Spec:�Rock�wins�Scissors�*) implement{}�rps_win_s�(x)�=�let ��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) ��prval�()�=�rps_win_p_r_pf() ��prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end extern�praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*� Spec:�Paper�wins�Rock�*) extern�praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*� Spec:�Scissors�win�Paper�*) extern�praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*� Spec:�Rock�wins�Scissors�*) implement{}�rps_win_s�(x)�=�let ��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) ��prval�()�=�rps_win_p_r_pf() ��prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end extern�praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*� Spec:�Paper�wins�Rock�*) extern�praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*� Spec:�Scissors�win�Paper�*) extern�praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*� Spec:�Rock�wins�Scissors�*) implement{}�rps_win_s�(x)�=�let ��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) ��prval�()�=�rps_win_p_r_pf() ��prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end extern�praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*� Spec:�Paper�wins�Rock�*) extern�praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*� Spec:�Scissors�win�Paper�*) extern�praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*� Spec:�Rock�wins�Scissors�*) implement{}�rps_win_s�(x)�=�let ��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) ��prval�()�=�rps_win_p_r_pf() ��prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end extern praxi�rps_win_r_s_pf�():�[rps_win_sta(r_rps_s,�s_rps_s)]�void�(*� Spec:�Paper�wins�Rock�*) extern praxi�rps_win_p_r_pf�():�[rps_win_sta(p_rps_s,�r_rps_s)]�void�(*� Spec:�Scissors�win�Paper�*) extern praxi�rps_win_s_p_pf�():�[rps_win_sta(s_rps_s,�p_rps_s)]�void�(*� Spec:�Rock�wins�Scissors�*) implement{}�rps_win_s�(x)�=�let prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) prval�()�=�rps_win_p_r_pf() prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�p_rps_t() ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end
  • 15. Statics can catch error at compile-timeStatics can catch error at compile-timeStatics can catch error at compile-timeStatics can catch error at compile-timeStatics can catch error at compile-time implement{}�rps_win_s�(x)�=�let ��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) ��prval�()�=�rps_win_p_r_pf() ��prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end implement{}�rps_win_s�(x)�=�let ��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) ��prval�()�=�rps_win_p_r_pf() ��prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end implement{}�rps_win_s�(x)�=�let ��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) ��prval�()�=�rps_win_p_r_pf() ��prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end implement{}�rps_win_s�(x)�=�let ��prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) ��prval�()�=�rps_win_p_r_pf() ��prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end implement{}�rps_win_s�(x)�=�let prval�()�=�rps_win_r_s_pf()�(*�Introduce�specification�*) prval�()�=�rps_win_p_r_pf() prval�()�=�rps_win_s_p_pf() in ��case+�x�of ��│�r_rps_t()�=>�r_rps_t()�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�s_rps_t() ��│�s_rps_t()�=>�r_rps_t() end $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--� 942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();� S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar (r1$2870(7929)))) $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--� 942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();� S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar (r1$2870(7929)))) $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--� 942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();� S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar (r1$2870(7929)))) $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--� 942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();� S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar (r1$2870(7929)))) $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�933(line=36,�offs=18)�--� 942(line=36,�offs=27):�error(3):�unsolved�constraint:�C3NSTRprop(C3TKmain();� S2Eapp(S2Ecst(rps_win_sta);�S2EVar(4434->S2Eapp(S2Ecst(r_rps_s);�)),�S2Evar (r1$2870(7929))))
  • 16. Specification using Proofs of ATSSpecification using Proofs of ATSSpecification using Proofs of ATSSpecification using Proofs of ATSSpecification using Proofs of ATS dataprop�RPS_WIN�(rps_s,�rps_s)�= ��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*) ��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*) ��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*) fun{}�rps_win_p ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2)) dataprop�RPS_WIN�(rps_s,�rps_s)�= ��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*) ��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*) ��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*) fun{}�rps_win_p ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2)) dataprop�RPS_WIN�(rps_s,�rps_s)�= ��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*) ��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*) ��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*) fun{}�rps_win_p ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2)) dataprop�RPS_WIN�(rps_s,�rps_s)�= ��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*) ��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*) ��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*) fun{}�rps_win_p ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2)) dataprop�RPS_WIN�(rps_s,�rps_s)�= ��│�RPS_P_WIN_R�(p_rps_s,�r_rps_s)�(*�Spec:�Paper�wins�Rock�*) ��│�RPS_S_WIN_P�(s_rps_s,�p_rps_s)�(*�Spec:�Scissors�win�Paper�*) ��│�RPS_R_WIN_S�(r_rps_s,�s_rps_s)�(*�Spec:�Rock�wins�Scissors�*) fun{}�rps_win_p ��{r1:rps_s}�(x:�rps_t�(r1)): ��[r2:rps_s]�(RPS_WIN�(r2,�r1)�│�rps_t�(r2))
  • 17. Implementation using Proofs of ATSImplementation using Proofs of ATSImplementation using Proofs of ATSImplementation using Proofs of ATSImplementation using Proofs of ATS implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t()) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t()) implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t()) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t()) implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t()) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t()) implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t()) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t()) implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_P_WIN_R()�│�p_rps_t()) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())
  • 18. Proofs can catch error at compile-timeProofs can catch error at compile-timeProofs can catch error at compile-timeProofs can catch error at compile-timeProofs can catch error at compile-time implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t()) implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t()) implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t()) implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t()) implement{}�rps_win_p�(x)�=�case+�x�of ��│�r_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t())�(*�Compile-time�error!�*) ��│�p_rps_t()�=>�(RPS_S_WIN_P()�│�s_rps_t()) ��│�s_rps_t()�=>�(RPS_R_WIN_S()�│�r_rps_t()) $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--� 1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned� the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst (RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst (rps_t);�S2Evar(r2$2876(7935)))))]. $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--� 1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned� the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst (RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst (rps_t);�S2Evar(r2$2876(7935)))))]. $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--� 1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned� the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst (RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst (rps_t);�S2Evar(r2$2876(7935)))))]. $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--� 1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned� the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst (RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst (rps_t);�S2Evar(r2$2876(7935)))))]. $�patscc�main.dats�-DATS_MEMALLOC_LIBC /home/kiwamu/src/practice-ats/static_rps/rps.dats:�1199(line=45,�offs=18)�--� 1226(line=45,�offs=45):�error(3):�the�dynamic�expression�cannot�be�assigned� the�type�[S2Eexi(r2$2876(7935);�;�S2Etyrec(flt0;�npf=1;�0=S2Eapp(S2Ecst (RPS_WIN);�S2Evar(r2$2876(7935)),�S2Evar(r1$2875(7934))),�1=S2Eapp(S2Ecst (rps_t);�S2Evar(r2$2876(7935)))))].
  • 19. The code is found at GitHubThe code is found at GitHubThe code is found at GitHubThe code is found at GitHubThe code is found at GitHub https://github.com/jats-ug/practice-ats/tree/master/static_rpshttps://github.com/jats-ug/practice-ats/tree/master/static_rpshttps://github.com/jats-ug/practice-ats/tree/master/static_rpshttps://github.com/jats-ug/practice-ats/tree/master/static_rpshttps://github.com/jats-ug/practice-ats/tree/master/static_rps
  • 20. License of photosLicense of photosLicense of photosLicense of photosLicense of photos *�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"� interact. ��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper- scissors.svg ��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0 *�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/zombiesquirrels/3477986919/ ��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0 *�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:� Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/31029865@N06/15018892358/ ��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0 *�Cuddle�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/peptravassos/14206994372/ ��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0 *�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/stevelacey/5820920545/ ��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0 *�Imagine�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tonythemisfit/4773974792/ ��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0 *�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"� interact. ��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper- scissors.svg ��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0 *�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/zombiesquirrels/3477986919/ ��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0 *�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:� Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/31029865@N06/15018892358/ ��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0 *�Cuddle�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/peptravassos/14206994372/ ��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0 *�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/stevelacey/5820920545/ ��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0 *�Imagine�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tonythemisfit/4773974792/ ��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0 *�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"� interact. ��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper- scissors.svg ��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0 *�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/zombiesquirrels/3477986919/ ��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0 *�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:� Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/31029865@N06/15018892358/ ��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0 *�Cuddle�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/peptravassos/14206994372/ ��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0 *�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/stevelacey/5820920545/ ��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0 *�Imagine�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tonythemisfit/4773974792/ ��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0 *�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"� interact. ��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper- scissors.svg ��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0 *�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/zombiesquirrels/3477986919/ ��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0 *�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:� Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/31029865@N06/15018892358/ ��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0 *�Cuddle�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/peptravassos/14206994372/ ��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0 *�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/stevelacey/5820920545/ ��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0 *�Imagine�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tonythemisfit/4773974792/ ��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0 *�A�chart�showing�how�the�three�game�elements�of�"Rock-paper-scissors"� interact. ��https://en.wikipedia.org/wiki/Rock-paper-scissors#/media/File:Rock-paper- scissors.svg ��Copyright:�Antonsusi�/�License:�CC�BY-SA�3.0 *�Scissors�Rock�Paper�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/zombiesquirrels/3477986919/ ��Copyright:�Mike�Souza�/�License:�CC�BY-SA�2.0 *�AKB48�34th�Single�Selection�Rock,�Paper,�Scissors�Tournament:� Advertisement�at�Shibuya�Station�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/31029865@N06/15018892358/ ��Copyright:�Dick�Thomas�Johnson�/�License:�CC�BY�2.0 *�Cuddle�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/peptravassos/14206994372/ ��Copyright:�Pedro�Travassos�/�License:�CC�BY�2.0 *�Corey�Donohoe�(GitHub):�Metrics�Driven�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/stevelacey/5820920545/ ��Copyright:�Steve�Lacey�/�License:�CC�BY�2.0 *�Imagine�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tonythemisfit/4773974792/ ��Copyright:�Tony�Fischer�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0