ISO/IEC JTC1 SC22 WG17
A comparison of contemporary implementations of number_chars/2

This comparison includes contemporary systems with the directive set_prolog_flag(double_quotes,chars). It includes all cases 1..53 from the original comparison which was used in preparation of Cor.2.

ISO Prolog works, comparison of syntax

#Queryanswer description SICStus 4.9.0 Scryer 0.9.4 Trealla 2.52.25 GNU 1.6.0 Ichiban 1.2.0 ECLiPSe 7.0#42 -L iso Tau 0.3.4 X 1.0.63 SWI 9.3.17 YAP 7.4.0 B 7.8b7 Minerva 2.4 IF V5.1B IV 1.4.2
#Queryanswer description SI Sc Tr GN Ic EC Τ X SW YA B Mi IF IV
1?- number_chars(1.2,"1.2"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK OK
2?- number_chars(1.0e9,"1.0E9"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK OK
3?- number_chars(1,"01"). true. OK OK OK OK OK OK OK OK OK OK OK false OK OK
4?- number_chars(1,"a"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK false OK OK
5?- number_chars(1,[]). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK false OK OK
6?- number_chars(1,[[]]). type_error(character,[]). OK OK OK OK OK OK OK OK OK OK OK false OK OK
7?- number_chars(1,[' ',[]]). type_error(character,[]). OK OK OK OK OK OK OK OK OK OK OK false OK OK
8?- number_chars(1,[0]). type_error(character,0). OK OK OK OK OK OK OK OK s._e.(..) aborts OK false OK OK
9?- number_chars(1,[_,[]]). type_error(character,[]). OK OK OK OK OK OK OK OK false false false false OK OK
10?- number_chars(N,[X]). instantiation_error. OK OK OK OK OK OK OK OK OK OK OK OK OK OK
11?- number_chars(N,['0'|_]). instantiation_error. OK OK OK OK OK OK OK OK OK OK OK OK OK OK
12?- number_chars(N,'1'). type_error(list,'1'). OK OK OK OK OK OK OK OK OK OK OK OK OK OK
13?- number_chars(N,[a|a]). type_error(list,[a|a]). OK OK OK OK OK OK OK OK OK OK OK ..(..,a) OK OK
14?- number_chars(N,[49]). type_error(character,49). OK OK OK OK OK OK OK OK N = 1 N = 1 OK OK OK OK
15?- number_chars(N,[]). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK
16?- number_chars(N,"3 "). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK N = 3 OK
17?- number_chars(N,"3."). syntax_error(...). OK OK OK OK OK OK OK OK OK N = 3 OK N = 3.0 OK OK
18?- number_chars(N," 1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK OK OK OK
19?- number_chars(N,"\n1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK OK s._e.(..) OK
20?- number_chars(N," 0'a"). N = 0'a.
N = 97.
OK OK OK OK OK OK OK OK OK OK OK OK OK OK
21?- number_chars(N,"- 1"). N = -1. OK OK OK OK OK OK s._e.(..) OK s._e.(..) aborts OK s._e.(..) OK s._e.(..)
54?- number_chars(N,"'-'1"). N = -1. OK OK OK s._e.(..) OK OK OK OK s._e.(..) aborts s._e.(..) s._e.(..) s._e.(..) s._e.(..)
22?- number_chars(N,"/**/1"). N = 1. OK OK OK s._e.(..) OK OK OK OK s._e.(..) aborts OK s._e.(..) s._e.(..) OK
23?- number_chars(N,"%\n1"). N = 1. OK OK OK s._e.(..) OK OK OK s._e.(..) s._e.(..) aborts OK s._e.(..) s._e.(..) OK
24?- number_chars(N,"-/**/1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts N -1 OK OK OK
25?- number_chars(N,"1e1"). syntax_error(...). OK OK OK OK OK OK OK OK N = 10.0 N = 10.0 OK N = 10.0 OK OK
26?- number_chars(N,"1.0e"). syntax_error(...). OK OK OK OK OK OK OK OK OK N = 1 OK OK OK OK
27?- number_chars(N,"1.0ee"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK
28?- number_chars(N,"0x1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK OK OK OK
29?- number_chars(N,"0X1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK
30?- number_chars(N,"1E1"). syntax_error(...). OK OK OK OK OK OK OK OK N = 10.0 N = 10.0 OK N = 10.0 N = 10.0 OK
47?- number_chars(1,['.'|_]). false. OK OK OK OK OK OK OK OK OK OK i._e. OK i._e. OK
48?- number_chars(N,"+1"). syntax_error(...). OK OK OK OK OK OK OK OK N = 1 N = 1 OK N = 1 N = 1 OK
49?- number_chars(N,"+ 1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK N = 1 OK
50?- number_chars(N,"'+'1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK
51?- number_chars(N,['11']). type_error(character,'11'). OK OK OK OK OK OK OK OK ..(c._c.,..) OK OK OK OK OK
52?- number_chars(N,['1.1']). type_error(character,'1.1'). OK OK OK OK OK OK OK OK ..(c._c.,..) OK OK OK OK OK
53?- number_chars(1+1,"2"). type_error(number,1+1). OK OK OK OK OK false OK OK OK false OK ..(d.,..) true OK
31?- number_chars(1,[C]). C = '1'. OK OK OK OK OK OK OK OK OK OK OK OK OK t._e.(c.,_)
32?- number_chars(1,[C,D]). false. OK OK OK OK OK OK OK OK OK OK OK OK i._e. t._e.(c.,_)
33?- number_chars(1,[C,C]). false. OK OK OK OK OK OK OK OK OK OK OK OK i._e. t._e.(c.,_)
34?- number_chars(0,[C,C]). false. OK OK OK OK OK OK OK OK OK OK OK OK i._e. t._e.(c.,_)
35?- number_chars(10,[C,D]). C = '1', D = '0'. OK OK OK OK OK OK OK OK OK OK OK OK OK t._e.(c.,_)
36?- number_chars(100,[C,D]). false. OK OK OK OK OK OK OK OK OK OK OK OK i._e. t._e.(c.,_)
37?- number_chars(N,[X|2]). type_error(list,[_|2])
| instantiation_error.
t. i. t. i. i. t. t. i. i. i. i. i. i. i.
38?- number_chars(N,[1|_]). instantiation_error
| type_error(character,1).
t. i. t. t. t. t. t. t. i. i. t. t. t. i.
39?- number_chars(V,[1|2]). type_error(list,[1|2])
| type_error(character,1).
l. l. l. c. c. c. c. c. l. l. c. c. c. c.
40?- number_chars([],1). type_error(number,[])
| type_error(list,1).
n. n. n. n. l. l. n. n. n. ..(t.,1) n. ..(d.,[]) n. n.
41?- number_chars(1,1). type_error(list,1). OK OK OK OK OK OK OK OK OK ..(t.,1) OK OK OK OK
42?- number_chars(1,[a|2]). type_error(list,[a|2]). OK OK OK OK OK OK OK OK OK ..(..,2) OK false OK false
43?- number_chars(1,[_|2]). type_error(list,[_|2]). OK OK OK OK OK OK OK OK false false OK false OK ..(c.,_)
44?- number_chars(1,[[]|_]). type_error(character,[]). OK OK OK OK OK OK OK OK ..(c._c.,[]) false i._e. false OK OK
45?- number_chars(1,[[]|2]). type_error(character,[])
| type_error(list,[[]|2]).
l. l. l. c. c. c. c. c. ..(c._c.,[]) c. l. false c. c.
46?- L=['1'|L], number_chars(N,L).
% * is default
sto, ... ; ... .
type_error(list,['1'|...]) % rational trees
| false % occurs-check
| representation_error(term)
| instantiation_error % literal substitutions
| loops.

t*

t*
|f
|r

t*
|f
|r





l*

t*





l*


f

|i*

t*

t*
|f
|oc._c.(_,..)

t*





l*





l*





l*





l
classmeaning
regregular use
goodconforming
corpcorrect but problematic
badxextension
badcerror's culprit wrong
badterror's type wrong
badeerror class wrong
badrrejection unexpected
badmmisinterpretation
badvvulnerability
quad

Systems not considered

See original comparison for their conformity.

XSB 5.0.0:

| ?- set_prolog_flag(double_quotes,chars).
++Error[XSB/Runtime/P]: [Domain (chars not in domain flag_value)] unexpected.

Ciao 1.24.0:

?-  set_prolog_flag(double_quotes,chars).

yes
?- writeq("abc").
[97,98,99] unexpected.
yes

Validated HTML