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

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

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