Admin User, created Apr 07. 2025
/**
* Warranty & Liability
* To the extent permitted by applicable law and unless explicitly
* otherwise agreed upon, XLOG Technologies AG makes no warranties
* regarding the provided information. XLOG Technologies AG assumes
* no liability that any problems might be solved with the information
* provided by XLOG Technologies AG.
*
* Rights & License
* All industrial property rights regarding the information - copyright
* and patent rights in particular - are the sole property of XLOG
* Technologies AG. If the company was not the originator of some
* excerpts, XLOG Technologies AG has at least obtained the right to
* reproduce, change and translate the information.
*
* Reproduction is restricted to the whole unaltered document. Reproduction
* of the information is only allowed for non-commercial uses. Selling,
* giving away or letting of the execution of the library is prohibited.
* The library can be distributed as part of your applications and libraries
* for execution provided this comment remains unchanged.
*
* Restrictions
* Only to be distributed with programs that add significant and primary
* functionality to the library. Not to be distributed with additional
* software intended to replace any components of the library.
*
* Trademarks
* Jekejeke is a registered trademark of XLOG Technologies AG.
*/
/**
* Source of test cases are the following standards:
* - Prolog General Core ISO/IEC 13211-1
*/
runner_file(stream, number, 'XLOG 4.2 number').
/****************************************************************/
/* Number Predicate */
/****************************************************************/
/* number_codes(X, Y) */
runner_pred(number_codes, 2, stream, number, 'ISO 8.16.8.4').
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, ISO 1') :-
number_codes(33, L), L == "33".
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, ISO 2') :-
number_codes(33, "33").
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, ISO 3') :-
number_codes(33.0, L), L == "33.0".
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, XLOG 1') :-
number_codes(33.0, "3.3e+01").
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, ISO 5') :-
number_codes(A, "-25"), A == -25.
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, XLOG 2') :-
catch(number_codes(_, " 3"), error(E,_), true),
E == syntax_error(illegal_number).
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, ISO 7') :-
catch(number_codes(_, "0xf"), error(E,_), true),
E == syntax_error(illegal_number).
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, ISO 8') :-
catch(number_codes(_, "0'a"), error(E,_), true),
E == syntax_error(illegal_number).
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, ISO 9') :-
number_codes(A, "4.2"), A == 4.2.
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, ISO 10') :-
number_codes(A, "42.0e-1"), A == 4.2.
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, XLOG 3') :-
catch(number_codes(_, "0X1"), error(E,_), true),
E == syntax_error(illegal_number).
runner_case(number_codes, 2, stream, number, 'ISO 8.16.8.4, XLOG 4') :-
catch(number_codes(_,_), error(E,_), true),
E == instantiation_error.
/****************************************************************/
/* Machine Statistics */
/****************************************************************/
runner_pred(statistics, 2, stream, number, 'XLOG 4.2.1').
runner_case(statistics, 2, stream, number, 'XLOG 4.2.1, XLOG 1') :-
statistics(wall, X), integer(X).
runner_case(statistics, 2, stream, number, 'XLOG 4.2.1, XLOG 2') :-
statistics(wall, X), X >= 0.
runner_case(statistics, 2, stream, number, 'XLOG 4.2.1, XLOG 3') :-
catch(statistics(foo, _), error(E,_), true),
E == domain_error(prolog_flag, foo).