?- explain(aGF_43423).
"aGF_43423" is an atom
true.

?- explain(aGF_4342&).
ERROR: Syntax error: Operator expected
ERROR: explain(aGF_4342
ERROR: ** here **
ERROR: &) . 
?- explain('gjdfgjkelktjerlk349058340958%$#%#$%#$%345').
"gjdfgjkelktjerlk349058340958%$#%#$%#$%345" is an atom
true.

?- explain('$##$^#$').
"$##$^#$" is an atom
true.

?- explain('$##$^#gfd$').
"$##$^#gfd$" is an atom
true.

?- explain($##$^$).
"$##$^$" is an atom
true.

?- explain($##$^gfdgfdg$).
ERROR: Syntax error: Operator expected
ERROR: explain($##$^
ERROR: ** here **
ERROR: gfdgfdg$) . 
?- explain(4234324).
"4234324" is an integer
true.

?- explain(4234324.54235).
"4.23432e+06" is a floating point number
true.

?- explain(4234324.54235e-056).
"4.23432e-50" is a floating point number
true.

?- explain(X).
"_G180" is an unbound variable
true.

?- explain(_).
"_G180" is an unbound variable
true.

?- explain(fdsdf
|    .
ERROR: Syntax error: Unexpected end of clause
ERROR: explain(fdsdf 
ERROR: ** here **
ERROR: . 
?- explain(fdsdf(ggf,gfdg)).
"fdsdf(ggf, gfdg)" is a compound term
true.

?- explain(fdsdf(ggf,X)).
"fdsdf(ggf, _)" is a compound term
true.

?- explain('gfdgdfgdf'(ggf,X)).
"gfdgdfgdf(ggf, _)" is a compound term
true.

?- explain($#$@@(ggf,X)).
"$#$@@(ggf, _)" is a compound term
true.

?- explain($#$@@ (ggf,X)).
ERROR: Syntax error: Operator expected
ERROR: explain($#$@@ (ggf,X
ERROR: ** here **
ERROR: )) . 
?- explain($#$@@(ggf, X)).
"$#$@@(ggf, _)" is a compound term
true.

?- functor(fsdf(1,3)).
ERROR: Undefined procedure: functor/1
ERROR:     However, there are definitions for:
ERROR:         functor/3
false.

?- functor(fsdf(1,3), X,Y).
X = fsdf,
Y = 2.

?- direct(toronto,ottawa).
true ;;
false.

?- help.
true.

?- help(functor).
true.

?- direct(toronto,montreal).
false.

?- connection(toronto,montreal).
true .

?- listing.

direct(toronto, ottawa).
direct(toronto, winnipeg).
direct(ottawa, montreal).
direct(montreal, albany).

%   Foreign: rl_read_history/1

%   Foreign: rl_write_history/1

%   Foreign: rl_add_history/1

%   Foreign: rl_read_init_file/1

connection(A, B) :-
	direct(A, B).
connection(A, C) :-
	direct(A, B),
	connection(B, C).
true.

?- [connections].
% connections compiled 0.00 sec, 404 bytes
true.

?- listing.

direct(toronto, ottawa).
direct(toronto, winnipeg).
direct(ottawa, montreal).
direct(montreal, albany).

%   Foreign: rl_read_history/1

%   Foreign: rl_write_history/1

list_connections :-
	connection(A, B),
	write('Theres a connecting flight between '),
	write(A),
	write(' and '),
	write(B),
	nl,
	fail.

%   Foreign: rl_add_history/1

%   Foreign: rl_read_init_file/1

connection(A, B) :-
	direct(A, B).
connection(A, C) :-
	direct(A, B),
	connection(B, C).
true.

?- list_connections.
Theres a connecting flight between toronto and ottawa
Theres a connecting flight between toronto and winnipeg
Theres a connecting flight between ottawa and montreal
Theres a connecting flight between montreal and albany
Theres a connecting flight between toronto and montreal
Theres a connecting flight between toronto and albany
Theres a connecting flight between ottawa and albany
false.

?- 
% halt
