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:2012.

ISO Prolog works, comparison of syntax

#Queryanswer description 8.16.7 SICStus 4.9.0 Scryer 0.10.0 Trealla 2.52.25 Ichiban 1.2.0 GNU 1.6.0 X 1.0.63 Tau 0.3.4 ECLiPSe 7.0#42 -L iso IV 1.4.2 SWI 9.3.17 YAP 7.4.0 B 7.8b7 IF V5.1B Minerva 2.4 Cx 0.98.3 pre Cor.2 Flowlog 4.7.1
#Queryanswer description SI Sc Tr 1b GN X Τ EC IV SW YA B IF Mi Cx -2 Fl
1?- number_chars(1.2,"1.2"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
55?- number_chars(1.2,"1.20"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK false false OK OK
2?- number_chars(1.0e9,"1.0E9"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK OK false OK OK
56?- number_chars(1.0e9,"1.0e9"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK false false OK OK
64?- number_chars(0.0,"-0.0"). true. OK OK OK OK OK OK OK false OK false OK false OK false false OK OK
3?- number_chars(1,"01"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK false false OK OK
65?- number_chars(10,"010"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK false false OK false
66?- number_chars(N,"010"). N=10. OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK N=8
67?- number_chars(N,"08"). N=8. OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK s._e.(..)
68?- number_chars(N,"0b11"). N=3. OK OK OK OK OK OK OK OK OK OK OK OK OK OK false OK s._e.(..)
69?- number_chars(N,"0o11"). N=9. OK OK OK OK OK OK OK OK OK OK OK OK OK OK false OK s._e.(..)
70?- number_chars(N,"0x11"). N=17. OK OK OK OK OK OK OK OK OK OK OK OK OK OK N=17.0 OK OK
4?- number_chars(1,"a"). syntax_error(...). OK OK OK OK OK OK OK OK OK OK aborts OK OK false false OK OK
5?- number_chars(1,[]). syntax_error(...). OK OK OK OK OK OK OK OK OK OK aborts OK OK false false OK OK
6?- number_chars(1,[[]]). type_error(character,[]). OK OK OK OK OK OK OK OK OK OK OK OK OK false false OK OK
7?- number_chars(1,[' ',[]]). type_error(character,[]). OK OK OK OK OK OK OK OK OK OK OK OK OK false false OK OK
8?- number_chars(1,[0]). type_error(character,0). OK OK OK OK OK OK OK OK OK s._e.(..) aborts OK OK false false OK OK
9?- number_chars(1,[_,[]]). type_error(character,[]). OK OK OK OK OK OK OK OK OK false false false OK 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 OK OK OK
11?- number_chars(N,['0'|_]). instantiation_error. OK OK OK 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 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 OK OK ..(..,a) i._e. OK OK
14?- number_chars(N,[49]). type_error(character,49). OK OK OK OK OK OK OK OK OK N=1 N=1 OK OK OK OK OK OK
15?- number_chars(N,[]). syntax_error(...). OK OK OK OK OK OK OK OK OK OK aborts OK OK OK false OK OK
16?- number_chars(N,"3 "). syntax_error(...). OK OK OK OK OK OK OK OK OK OK aborts OK N=3 OK false OK OK
17?- number_chars(N,"3."). syntax_error(...). OK OK OK OK OK OK OK OK OK OK N=3 OK OK N=3.0 false OK N=3.0
18?- number_chars(N," 1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK OK OK OK false OK OK
19?- number_chars(N,"\n1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK OK s._e.(..) OK false OK 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 false OK OK
58?- number_chars(N,"0'"). syntax_error(...). OK ON ON OK OK OK OK N=0 OK OK N= -1 OK OK OK false OK OK
59?- number_chars(N,"0'\n"). syntax_error(...). OK OK ON OK OK OK j.err OK OK N=10 N=10 N=10 N=10 N=10 false OK N=10
60?- number_chars(N,"0'\\n"). N=0'\n. N=10. OK OK OK OK OK OK OK OK OK s._e.(..) OK OK OK OK false OK OK
61?- number_chars(N,"0'\\7\\"). N=7. OK OK OK OK OK OK OK OK OK s._e.(..) OK OK s._e.(..) OK false OK OK
62?- number_chars(N,"0'."). N=0'. . N = 46. OK ON OK OK OK OK OK OK OK OK OK OK OK OK false OK OK
21?- number_chars(N,"- 1"). N = -1. OK OK OK OK OK OK s._e.(..) OK s._e.(..) s._e.(..) aborts OK OK s._e.(..) false OK s._e.(..)
54?- number_chars(N,"'-'1"). N = -1. OK OK OK OK ON OK OK OK s._e.(..) s._e.(..) aborts s._e.(..) s._e.(..) s._e.(..) false OK s._e.(..)
22?- number_chars(N,"/**/1"). N = 1. OK OK OK OK ON OK OK OK OK s._e.(..) aborts OK s._e.(..) s._e.(..) false OK s._e.(..)
23?- number_chars(N,"%\n1"). N = 1. OK OK OK OK ON s._e.(..) OK OK OK s._e.(..) aborts OK s._e.(..) s._e.(..) false OK s._e.(..)
57?- number_chars(N,"- /**/1"). N = -1. OK OK OK OK ON OK s._e.(..) OK s._e.(..) s._e.(..) aborts OK s._e.(..) s._e.(..) false OK s._e.(..)
24?- number_chars(N,"-/**/1"). syntax_error(...). OK OK OK OK OK OK OK OK OK OK aborts N= -1 OK OK false OK OK
63?- number_chars(N,"'\\\n-' 3"). N= -3. OK OK ON OK ON OK s._e.(..) OK s._e.(..) s._e.(..) aborts s._e.(..) s._e.(..) s._e.(..) false OK s._e.(..)
25?- number_chars(N,"1e1"). syntax_error(...). OK OK OK OK OK OK OK OK OK N=10.0 N=10.0 OK OK N=10.0 N=10.0 OK N=10.0
26?- number_chars(N,"1.0e"). syntax_error(...). OK OK OK OK OK OK OK OK OK OK N=1 OK OK OK false OK OK
27?- number_chars(N,"1.0ee"). syntax_error(...). OK OK OK OK OK OK OK OK OK OK aborts OK OK OK false OK OK
28?- number_chars(N,"0x1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK OK OK OK N=1.0 OK OK
29?- number_chars(N,"0X1"). syntax_error(...). OK OK OK OK OK OK OK OK OK OK aborts OK OK OK N=1.0 OK N=1
30?- number_chars(N,"1E1"). syntax_error(...). OK OK OK OK OK OK OK OK OK N=10.0 N=10.0 OK N=10.0 N=10.0 N=10.0 OK N=10.0
47?- number_chars(1,['.'|_]). false. OK OK OK OK OK OK OK OK OK OK OK i._e. i._e. OK false OK OK
48?- number_chars(N,"+1"). syntax_error(...). OK OK OK OK OK OK OK OK OK N=1 N=1 OK N=1 N=1 false OK N=1
49?- number_chars(N,"+ 1"). syntax_error(...). OK OK OK OK OK OK OK OK OK OK aborts OK N=1 OK false OK OK
50?- number_chars(N,"'+'1"). syntax_error(...). OK OK OK OK OK OK OK OK OK OK aborts OK OK OK false OK OK
51?- number_chars(N,['11']). type_error(character,'11'). OK OK OK OK OK OK OK OK OK ..(c._c.,..) OK OK OK OK OK OK OK
52?- number_chars(N,['1.1']). type_error(character,'1.1'). OK OK OK OK OK OK OK OK OK ..(c._c.,..) OK OK OK OK OK OK OK
53?- number_chars(1+1,"2"). type_error(number,1+1). OK OK OK OK OK OK OK false OK OK false OK true ..(d.,..) ..(a.,..) OK OK
31?- number_chars(1,[C]). C = '1'. OK OK OK OK OK OK OK OK t._e.(c.,_) OK OK OK OK OK OK t._e.(c.,_) OK
32?- number_chars(1,[C,D]). false. OK OK OK OK OK OK OK OK t._e.(c.,_) OK OK OK i._e. OK OK t._e.(c.,_) OK
33?- number_chars(1,[C,C]). false. OK OK OK OK OK OK OK OK t._e.(c.,_) OK OK OK i._e. OK OK t._e.(c.,_) OK
34?- number_chars(0,[C,C]). false. OK OK OK OK OK OK OK OK t._e.(c.,_) OK OK OK i._e. OK OK t._e.(c.,_) OK
35?- number_chars(10,[C,D]). C = '1', D = '0'. OK OK OK OK OK OK OK OK t._e.(c.,_) OK OK OK OK OK OK t._e.(c.,_) OK
36?- number_chars(100,[C,D]). false. OK OK OK OK OK OK OK OK t._e.(c.,_) OK OK OK i._e. OK OK t._e.(c.,_) OK
37?- number_chars(N,[X|2]). type_error(list,[_|2])
| instantiation_error.
t.
i.
t.
i.

i.

i.
t. t.
i.

i.

i.

i.

i.

i.

i.
t. t.
38?- number_chars(N,[1|_]). instantiation_error
| type_error(character,1).

t.
i.
t.

t.

t.

t.

t.

t.
i. i. i.
t.

t.

t.

t.
i. i.
39?- number_chars(V,[1|2]). type_error(list,[1|2])
| type_error(character,1).
l. l. l.
c.

c.

c.

c.

c.

c.
l. l.
c.

c.

c.

c.
l. l.
40?- number_chars([],1). type_error(number,[])
| type_error(list,1).
n. n. n.
l.
n. n. n.
l.
n. n. ..(t.,1) n. n. ..(d.,[]) ..(a.,[]) n. n.
41?- number_chars(1,1). type_error(list,1). OK OK OK OK OK OK OK OK OK OK ..(t.,1) OK OK OK false false OK
42?- number_chars(1,[a|2]). type_error(list,[a|2]). OK OK OK OK OK OK OK OK false OK ..(..,2) OK OK false false false OK
43?- number_chars(1,[_|2]). type_error(list,[_|2]). OK OK OK OK OK OK OK OK ..(c.,_) false false OK OK false false false OK
44?- number_chars(1,[[]|_]). type_error(character,[]). OK OK OK OK OK OK OK OK OK ..(c._c.,[]) false i._e. OK false false false OK
45?- number_chars(1,[[]|2]). type_error(character,[])
| type_error(list,[[]|2]).

l.

l.

l.
c. c. c. c. c. c. ..(c._c.,[]) c.
l.
c. false false false c.
46?- L=['1'|L], number_chars(N,L).
% * is default
sto, ... ; ... .
sto,
( type_error(list,['1'|...]) % rational trees
| false % occurs-check
| representation_error(term)
| instantiation_error % literal substitutions
| resource_error(...)
| loops
).


t*


t*
|f
|r


t*
|f
|r


t*







l*


t*



f

|i*







l*







l*


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


t*







l*







l*







l*







l*
sto






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

JI 3.1.0-2

JIP:-set_prolog_flag(double_quotes,chars).
- Warning, the predicate set_prolog_flag/2 is undefined.
No

JIP:-writeq("abc").
[97, 98, 99] unexpected
Yes

Version Control, Validated HTML