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 X 1.0.63 GNU 1.6.0 Tau 0.3.4 ECLiPSe 7.0#42 -L iso SWI 9.3.17 YAP 7.4.0 B 7.8b7 IF V5.1B IV 1.4.2 Minerva 2.4 Cx 0.98.3 pre Cor.2
#Queryanswer description SI Sc Tr Ic X GN Τ EC SW YA B IF IV Mi Cx -2
1?- number_chars(1.2,"1.2"). true. 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
2?- number_chars(1.0e9,"1.0E9"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK OK false 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
3?- number_chars(1,"01"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK false false OK
4?- number_chars(1,"a"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK false false OK
5?- number_chars(1,[]). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK false false OK
6?- number_chars(1,[[]]). type_error(character,[]). OK OK OK OK OK OK OK OK OK OK OK OK OK false false OK
7?- number_chars(1,[' ',[]]). type_error(character,[]). OK OK OK OK OK OK OK OK OK OK OK OK OK false false OK
8?- number_chars(1,[0]). type_error(character,0). OK OK OK OK OK OK OK OK s._e.(..) aborts OK OK OK false false OK
9?- number_chars(1,[_,[]]). type_error(character,[]). OK OK OK OK OK OK OK OK false false false OK OK false false OK
10?- number_chars(N,[X]). instantiation_error. 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
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
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
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 OK OK
15?- number_chars(N,[]). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK false OK
16?- number_chars(N,"3 "). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK N=3 OK OK false OK
17?- number_chars(N,"3."). syntax_error(...). OK OK OK OK OK OK OK OK OK N=3 OK OK OK N=3.0 false OK
18?- number_chars(N," 1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK OK OK OK false OK
19?- number_chars(N,"\n1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK s._e.(..) OK OK false 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
58?- number_chars(N,"0'"). syntax_error(...). OK ON ON OK OK OK OK N=0 OK N= -1 OK OK OK OK false OK
59?- number_chars(N,"0'\n"). syntax_error(...). OK OK ON OK OK OK j.err OK N=10 N=10 N=10 N=10 OK N=10 false OK
60?- number_chars(N,"0'\\n"). N=0'\n. N=10. OK OK OK OK OK OK OK OK s._e.(..) OK OK OK OK OK false OK
61?- number_chars(N,"0'\\7\\"). N=7. OK OK OK OK OK OK OK OK s._e.(..) OK OK s._e.(..) OK OK false 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
21?- number_chars(N,"- 1"). N = -1. OK OK OK OK OK OK s._e.(..) OK s._e.(..) aborts OK OK s._e.(..) s._e.(..) false OK
54?- number_chars(N,"'-'1"). N = -1. OK OK OK OK OK s._e.(..) OK OK s._e.(..) aborts s._e.(..) s._e.(..) s._e.(..) s._e.(..) false OK
22?- number_chars(N,"/**/1"). N = 1. OK OK OK OK OK s._e.(..) OK OK s._e.(..) aborts OK s._e.(..) OK s._e.(..) false OK
23?- number_chars(N,"%\n1"). N = 1. OK OK OK OK s._e.(..) s._e.(..) OK OK s._e.(..) aborts OK s._e.(..) OK s._e.(..) false OK
57?- number_chars(N,"- /**/1"). N = -1. OK OK OK OK OK s._e.(..) s._e.(..) OK s._e.(..) aborts OK s._e.(..) s._e.(..) s._e.(..) false OK
24?- number_chars(N,"-/**/1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts N= -1 OK OK OK false OK
63?- number_chars(N,"'\\\n-' 3"). N= -3. OK OK ON OK OK s._e.(..) s._e.(..) OK s._e.(..) aborts s._e.(..) s._e.(..) s._e.(..) s._e.(..) false OK
25?- number_chars(N,"1e1"). syntax_error(...). OK OK OK OK OK OK OK OK N=10.0 N=10.0 OK OK OK N=10.0 N=10.0 OK
26?- number_chars(N,"1.0e"). syntax_error(...). OK OK OK OK OK OK OK OK OK N=1 OK OK OK OK false OK
27?- number_chars(N,"1.0ee"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK false 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
29?- number_chars(N,"0X1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK N=1.0 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 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. i._e. OK OK false OK
48?- number_chars(N,"+1"). syntax_error(...). OK OK OK OK OK OK OK OK N=1 N=1 OK N=1 OK N=1 false OK
49?- number_chars(N,"+ 1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK N=1 OK OK false OK
50?- number_chars(N,"'+'1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK false 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 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 OK OK
53?- number_chars(1+1,"2"). type_error(number,1+1). OK OK OK OK OK OK OK false OK false OK true OK ..(d.,..) ..(a.,..) OK
31?- number_chars(1,[C]). C = '1'. OK OK OK OK OK OK OK OK OK OK OK OK t._e.(c.,_) OK OK t._e.(c.,_)
32?- number_chars(1,[C,D]). false. OK OK OK OK OK OK OK OK OK OK OK i._e. t._e.(c.,_) OK OK t._e.(c.,_)
33?- number_chars(1,[C,C]). false. OK OK OK OK OK OK OK OK OK OK OK i._e. t._e.(c.,_) OK OK t._e.(c.,_)
34?- number_chars(0,[C,C]). false. OK OK OK OK OK OK OK OK OK OK OK i._e. t._e.(c.,_) OK OK 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 t._e.(c.,_) OK OK t._e.(c.,_)
36?- number_chars(100,[C,D]). false. OK OK OK OK OK OK OK OK OK OK OK i._e. t._e.(c.,_) OK OK t._e.(c.,_)
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.
38?- number_chars(N,[1|_]). instantiation_error
| type_error(character,1).

t.
i.
t.

t.

t.

t.

t.

t.
i. i.
t.

t.
i.
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.

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

l.

l.

l.
c. c. c. c. c. ..(c._c.,[]) c.
l.
c. c. false false false
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
| loops
).


t*


t*
|f
|r


t*
|f
|r


t*


t*






l*



f

|i*






l*


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


t*






l*






l*






l*






l*






l*
sto
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