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 SICStus 4.9.0 Scryer 0.9.4 Trealla 2.52.25 Ichiban 1.2.0 GNU 1.6.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 IF V5.1B IV 1.4.2 Minerva 2.4 Cx 0.98.3
#Queryanswer description SI Sc Tr Ic GN EC Τ X SW YA B IF IV Mi Cx
1?- number_chars(1.2,"1.2"). true. 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
2?- number_chars(1.0e9,"1.0E9"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK OK false
56?- number_chars(1.0e9,"1.0e9"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK false false
3?- number_chars(1,"01"). true. OK OK OK OK OK OK OK OK OK OK OK OK OK false false
4?- number_chars(1,"a"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK false false
5?- number_chars(1,[]). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK false false
6?- number_chars(1,[[]]). type_error(character,[]). OK OK OK OK OK OK OK OK OK OK OK OK OK false false
7?- number_chars(1,[' ',[]]). type_error(character,[]). OK OK OK OK OK OK OK OK OK OK OK OK OK false false
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
9?- number_chars(1,[_,[]]). type_error(character,[]). OK OK OK OK OK OK OK OK false false false OK OK false false
10?- number_chars(N,[X]). instantiation_error. 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
12?- number_chars(N,'1'). type_error(list,'1'). 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.
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
15?- number_chars(N,[]). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK false
16?- number_chars(N,"3 "). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK N=3 OK OK false
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
18?- number_chars(N," 1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK OK OK OK false
19?- number_chars(N,"\n1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK s._e.(..) OK OK false
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
58?- number_chars(N,"0'"). syntax_error(...). OK ON ON OK OK N=0 OK OK OK N= -1 OK OK OK OK false
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
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
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
62?- number_chars(N,"0'."). N=0'. . N = 46. OK ON OK OK OK OK OK OK OK OK OK OK OK OK false
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
54?- number_chars(N,"'-'1"). N = -1. OK OK OK OK s._e.(..) OK OK OK s._e.(..) aborts s._e.(..) s._e.(..) s._e.(..) s._e.(..) false
22?- number_chars(N,"/**/1"). N = 1. OK OK OK OK s._e.(..) OK OK OK s._e.(..) aborts OK s._e.(..) OK s._e.(..) false
23?- number_chars(N,"%\n1"). N = 1. OK OK OK OK s._e.(..) OK OK s._e.(..) s._e.(..) aborts OK s._e.(..) OK s._e.(..) false
57?- number_chars(N,"- /**/1"). N = -1. OK OK OK OK s._e.(..) OK s._e.(..) OK s._e.(..) aborts OK s._e.(..) s._e.(..) s._e.(..) false
24?- number_chars(N,"-/**/1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts N= -1 OK OK OK false
63?- number_chars(N,"'\\\n-' 3"). N= -3. OK OK ON OK s._e.(..) OK s._e.(..) OK s._e.(..) aborts s._e.(..) s._e.(..) s._e.(..) t._e.(..) false
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
26?- number_chars(N,"1.0e"). syntax_error(...). OK OK OK OK OK OK OK OK OK N=1 OK OK OK OK false
27?- number_chars(N,"1.0ee"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK false
28?- number_chars(N,"0x1"). N = 1. OK OK OK OK OK OK OK OK OK OK OK OK OK OK N=1.0
29?- number_chars(N,"0X1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK N=1.0
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
47?- number_chars(1,['.'|_]). false. OK OK OK OK OK OK OK OK OK OK i._e. i._e. OK OK false
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
49?- number_chars(N,"+ 1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK N=1 OK OK false
50?- number_chars(N,"'+'1"). syntax_error(...). OK OK OK OK OK OK OK OK OK aborts OK OK OK OK false
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
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
53?- number_chars(1+1,"2"). type_error(number,1+1). OK OK OK OK OK false OK OK OK false OK true OK ..(d.,..) ..(a.,..)
31?- number_chars(1,[C]). C = '1'. OK OK OK OK OK OK OK OK OK OK OK OK t._e.(c.,_) OK OK
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
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
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
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
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
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.

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






l*






l*



f

|i*


t*


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


t*






l*






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

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