/* このテストプログラムはProlog版コンパイラで */
/* クローズインデキシングを掛けた場合のみ有効 */
%%% KL1-B Test for Jump_On_Non_Type %%%
% Jump_On_Non_Atm %%%%%%% abcdefg
% Jump_On_Non_Integer %%% abcdefg
% Jump_On_Non_List %%%%%% abcdefg
% Jump_On_Non_Vector %%%% abcdefg
% Jump_On_Non_String %%%% abcdefg
% Jump_On_Non_Float %%%%% abcdefg

:- module jnon_type.
:- public go/0.

go:- put_console(ascii#"%%% KL1-B Test for Jump_On_Non_Type %%%"), put_console(key#lf) | atm.

atm:- put_console(ascii#"% Jump_On_Non_Atm %%%%%%% ") | atm00.

atm00:- true | atm00(atom).
atm00(X):- atom(X), put_console(c#"a") | atm01.
atm00(X):- floating_point(X), put_console(c#"*") | atm01.
atm00(X):- wait(X), put_console(c#"*") | atm01.
alternatively.
atm00(_):- put_console(c#"*") | atm01.

atm01:- true | atm01(1234).
atm01(X):- atom(X), put_console(c#"*") | atm02.
atm01(X):- floating_point(X), put_console(c#"*") | atm02.
atm01(X):- wait(X), put_console(c#"b") | atm02.
alternatively.
atm01(_):- put_console(c#"*") | atm02.

atm02:- true | atm02([list]).
atm02(X):- atom(X), put_console(c#"*") | atm03.
atm02(X):- floating_point(X), put_console(c#"*") | atm03.
atm02(X):- wait(X), put_console(c#"c") | atm03.
alternatively.
atm02(_):- put_console(c#"*") | atm03.

atm03:- true | atm03({0,1}).
atm03(X):- atom(X), put_console(c#"*") | atm04.
atm03(X):- floating_point(X), put_console(c#"*") | atm04.
atm03(X):- wait(X), put_console(c#"d") | atm04.
alternatively.
atm03(_):- put_console(c#"*") | atm04.

atm04:- true | atm04(ascii#"String").
atm04(X):- atom(X), put_console(c#"*") | atm05.
atm04(X):- floating_point(X), put_console(c#"*") | atm05.
atm04(X):- wait(X), put_console(c#"e") | atm05.
alternatively.
atm04(_):- put_console(c#"*") | atm05.

atm05:- true | atm05(_).
atm05(X):- atom(X), put_console(c#"*") | atm06.
atm05(X):- floating_point(X), put_console(c#"*") | atm06.
atm05(X):- wait(X), put_console(c#"*") | atm06.
alternatively.
atm05(_):- put_console(c#"f") | atm06.

atm06:- true | atm06(12.34).
atm06(X):- atom(X), put_console(c#"*") | atm07.
atm06(X):- floating_point(X), put_console(c#"g") | atm07.

atm07:- put_console(key#lf) | int.

int:- put_console(ascii#"% Jump_On_Non_Integer %%% ") | int00.

int00:- true | int00(atom).
int00(X):- integer(X), put_console(c#"*") | int01.
int00(X):- floating_point(X), put_console(c#"*") | int01.
int00(X):- wait(X), put_console(c#"a") | int01.
alternatively.
int00(_):- put_console(c#"*") | int01.

int01:- true | int01(1234).
int01(X):- integer(X), put_console(c#"b") | int02.
int01(X):- floating_point(X), put_console(c#"*") | int02.
int01(X):- wait(X), put_console(c#"*") | int02.
alternatively.
int01(_):- put_console(c#"*") | int02.

int02:- true | int02([list]).
int02(X):- integer(X), put_console(c#"*") | int03.
int02(X):- floating_point(X), put_console(c#"*") | int03.
int02(X):- wait(X), put_console(c#"c") | int03.
alternatively.
int02(_):- put_console(c#"*") | int03.

int03:- true | int03({0,1}).
int03(X):- integer(X), put_console(c#"*") | int04.
int03(X):- floating_point(X), put_console(c#"*") | int04.
int03(X):- wait(X), put_console(c#"d") | int04.
alternatively.
int03(_):- put_console(c#"*") | int04.

int04:- true | int04(ascii#"String").
int04(X):- integer(X), put_console(c#"*") | int05.
int04(X):- floating_point(X), put_console(c#"*") | int05.
int04(X):- wait(X), put_console(c#"e") | int05.
alternatively.
int04(_):- put_console(c#"*") | int05.

int05:- true | int05(_).
int05(X):- integer(X), put_console(c#"*") | int06.
int05(X):- floating_point(X), put_console(c#"*") | int06.
int05(X):- wait(X), put_console(c#"*") | int06.
alternatively.
int05(_):- put_console(c#"f") | int06.

int06:- true | int06(12.34).
int06(X):- integer(X), put_console(c#"*") | int07.
int06(X):- floating_point(X), put_console(c#"g") | int07.

int07:- put_console(key#lf) | lst.

lst:- put_console(ascii#"% Jump_On_Non_List %%%%%% ") | lst00.

lst00:- true | lst00(atom).
lst00(X):- list(X), put_console(c#"*") | lst01.
lst00(X):- floating_point(X), put_console(c#"*") | lst01.
lst00(X):- wait(X), put_console(c#"a") | lst01.
alternatively.
lst00(_):- put_console(c#"*") | lst01.

lst01:- true | lst01(1234).
lst01(X):- list(X), put_console(c#"*") | lst02.
lst01(X):- floating_point(X), put_console(c#"*") | lst02.
lst01(X):- wait(X), put_console(c#"b") | lst02.
alternatively.
lst01(_):- put_console(c#"*") | lst02.

lst02:- true | lst02([list]).
lst02(X):- list(X), put_console(c#"c") | lst03.
lst02(X):- floating_point(X), put_console(c#"*") | lst03.
lst02(X):- wait(X), put_console(c#"*") | lst03.
alternatively.
lst02(_):- put_console(c#"*") | lst03.

lst03:- true | lst03({0,1}).
lst03(X):- list(X), put_console(c#"*") | lst04.
lst03(X):- floating_point(X), put_console(c#"*") | lst04.
lst03(X):- wait(X), put_console(c#"d") | lst04.
alternatively.
lst03(_):- put_console(c#"*") | lst04.

lst04:- true | lst04(ascii#"String").
lst04(X):- list(X), put_console(c#"*") | lst05.
lst04(X):- floating_point(X), put_console(c#"*") | lst05.
lst04(X):- wait(X), put_console(c#"e") | lst05.
alternatively.
lst04(_):- put_console(c#"*") | lst05.

lst05:- true | lst05(_).
lst05(X):- list(X), put_console(c#"*") | lst06.
lst05(X):- floating_point(X), put_console(c#"*") | lst06.
lst05(X):- wait(X), put_console(c#"*") | lst06.
alternatively.
lst05(_):- put_console(c#"f") | lst06.

lst06:- true | lst06(12.34).
lst06(X):- list(X), put_console(c#"*") | lst07.
lst06(X):- floating_point(X), put_console(c#"g") | lst07.

lst07:- put_console(key#lf) | vec.

vec:- put_console(ascii#"% Jump_On_Non_Vector %%%% ") | vec00.

vec00:- true | vec00(atom).
vec00(X):- vector(X), put_console(c#"*") | vec01.
vec00(X):- floating_point(X), put_console(c#"*") | vec01.
vec00(X):- wait(X), put_console(c#"a") | vec01.
alternatively.
vec00(_):- put_console(c#"*") | vec01.

vec01:- true | vec01(1234).
vec01(X):- vector(X), put_console(c#"*") | vec02.
vec01(X):- floating_point(X), put_console(c#"*") | vec02.
vec01(X):- wait(X), put_console(c#"b") | vec02.
alternatively.
vec01(_):- put_console(c#"*") | vec02.

vec02:- true | vec02([list]).
vec02(X):- vector(X), put_console(c#"*") | vec03.
vec02(X):- floating_point(X), put_console(c#"*") | vec03.
vec02(X):- wait(X), put_console(c#"c") | vec03.
alternatively.
vec02(_):- put_console(c#"*") | vec03.

vec03:- true | vec03({0,1}).
vec03(X):- vector(X), put_console(c#"d") | vec04.
vec03(X):- floating_point(X), put_console(c#"*") | vec04.
vec03(X):- wait(X), put_console(c#"*") | vec04.
alternatively.
vec03(_):- put_console(c#"*") | vec04.

vec04:- true | vec04(ascii#"String").
vec04(X):- vector(X), put_console(c#"*") | vec05.
vec04(X):- floating_point(X), put_console(c#"*") | vec05.
vec04(X):- wait(X), put_console(c#"e") | vec05.
alternatively.
vec04(_):- put_console(c#"*") | vec05.

vec05:- true | vec05(_).
vec05(X):- vector(X), put_console(c#"*") | vec06.
vec05(X):- floating_point(X), put_console(c#"*") | vec06.
vec05(X):- wait(X), put_console(c#"*") | vec06.
alternatively.
vec05(_):- put_console(c#"f") | vec06.

vec06:- true | vec06(12.34).
vec06(X):- vector(X), put_console(c#"*") | vec07.
vec06(X):- floating_point(X), put_console(c#"g") | vec07.

vec07:- put_console(key#lf) | str.

str:- put_console(ascii#"% Jump_On_Non_String %%%% ") | str00.

str00:- true | str00(atom).
str00(X):- string(X), put_console(c#"*") | str01.
str00(X):- floating_point(X), put_console(c#"*") | str01.
str00(X):- wait(X), put_console(c#"a") | str01.
alternatively.
str00(_):- put_console(c#"*") | str01.

str01:- true | str01(1234).
str01(X):- string(X), put_console(c#"*") | str02.
str01(X):- floating_point(X), put_console(c#"*") | str02.
str01(X):- wait(X), put_console(c#"b") | str02.
alternatively.
str01(_):- put_console(c#"*") | str02.

str02:- true | str02([list]).
str02(X):- string(X), put_console(c#"*") | str03.
str02(X):- floating_point(X), put_console(c#"*") | str03.
str02(X):- wait(X), put_console(c#"c") | str03.
alternatively.
str02(_):- put_console(c#"*") | str03.

str03:- true | str03({0,1}).
str03(X):- string(X), put_console(c#"*") | str04.
str03(X):- floating_point(X), put_console(c#"*") | str04.
str03(X):- wait(X), put_console(c#"d") | str04.
alternatively.
str03(_):- put_console(c#"*") | str04.

str04:- true | str04(ascii#"String").
str04(X):- string(X), put_console(c#"e") | str05.
str04(X):- floating_point(X), put_console(c#"*") | str05.
str04(X):- wait(X), put_console(c#"*") | str05.
alternatively.
str04(_):- put_console(c#"*") | str05.

str05:- true | str05(_).
str05(X):- string(X), put_console(c#"*") | str06.
str05(X):- floating_point(X), put_console(c#"*") | str06.
str05(X):- wait(X), put_console(c#"*") | str06.
alternatively.
str05(_):- put_console(c#"f") | str06.

str06:- true | str06(12.34).
str06(X):- string(X), put_console(c#"*") | str07.
str06(X):- floating_point(X), put_console(c#"g") | str07.

str07:- put_console(key#lf) | flt.

flt:- put_console(ascii#"% Jump_On_Non_Float %%%%% ") | flt00.

flt00:- true | flt00(atom).
flt00(1.2):- put_console(c#"*") | flt01.
flt00(X):- floating_point(X), put_console(c#"*") | flt01.
flt00(X):- wait(X), put_console(c#"a") | flt01.

flt01:- true | flt01(1234).
flt01(1.2):- put_console(c#"*") | flt02.
flt01(X):- floating_point(X), put_console(c#"*") | flt02.
flt01(X):- wait(X), put_console(c#"b") | flt02.

flt02:- true | flt02([list]).
flt02(1.2):- put_console(c#"*") | flt03.
flt02(X):- floating_point(X), put_console(c#"*") | flt03.
flt02(X):- wait(X), put_console(c#"c") | flt03.

flt03:- true | flt03({0,1}).
flt03(1.2):- put_console(c#"*") | flt04.
flt03(X):- floating_point(X), put_console(c#"*") | flt04.
flt03(X):- wait(X), put_console(c#"d") | flt04.

flt04:- true | flt04(ascii#"String").
flt04(1.2):- put_console(c#"*") | flt05.
flt04(X):- floating_point(X), put_console(c#"*") | flt05.
flt04(X):- wait(X), put_console(c#"e") | flt05.

flt05:- true | flt05(_).
flt05(1.2):- put_console(c#"*") | flt06.
flt05(X):- floating_point(X), put_console(c#"*") | flt06.
flt05(X):- wait(X), put_console(c#"*") | flt06.
alternatively.
flt05(_):- put_console(c#"f") | flt06.

flt06:- true | flt06(12.34).
flt06(1.2):- put_console(c#"*") | flt07.
flt06(X):- floating_point(X), put_console(c#"g") | flt07.
flt06(X):- wait(X), put_console(c#"*") | flt07.

flt07:- put_console(key#lf) | done.

done:- true | true.
