ISO-Prolog Syntax Compatibility

This is a mixture of tests for input syntax and for writeq output. The test instances here are the ones collected by Ulrich Neumerkel (as of 2013-11-29). This table is for ECLiPSe modules using the 'iso' language module. For modules in native ECLiPSe syntax, see separate table.

NrInputISO expectedECLiPSe 6.1.171 (iso)Remarks
1writeq('\n').'\n''\n'
Ok
2'syntax err.syntax_error
Ok
3)waitssyntax_error
Ok
261)
'
syntax err.syntax_error
Ok
4.syntax err.syntax_error
Ok
5writeq(' '). % horiz. tabsyntax err.syntax_error
Ok
1770'\t=0' . % horiz. tabsyntax err.syntax_error
Ok
6writeq('
').
syntax err.syntax_error
Ok
7writeq('\
'). % "\\\n"
''''
Ok
8writeq('\
a'). % "\\\na"
aa
Ok
9writeq('a\
b'). % "a\\\nb"
abab
Ok
10writeq('a\
 b'). % "a\\\n b"
'a b''a b'
Ok
11writeq('\ ').syntax err.syntax_error
Ok
193writeq('\ 
'). % "\\ \n"
syntax err.syntax_error
Ok
12writeq('\ '). % "\\\t"syntax err.syntax_error
Ok
13writeq('\t').'\t''\t'
Ok
14writeq('\a').e.g. '\a''\a'
Ok
15writeq('\7\').e.g. '\a''\a'
Ok
16writeq('\ca').syntax err.syntax_error
Ok
241writeq('\d').syntax err.syntax_error
Ok
17writeq('\e').syntax err.syntax_error
Ok
18writeq('\033\').e.g. '\33\''\33\'
Ok
19char_code('\e',C).syntax err.syntax_error
Ok
21char_code('\d',C).syntax err.syntax_error
Ok
22writeq('\u1').syntax err.syntax_error
Ok
23X = 0'\u1.syntax err.syntax_error
Ok
24writeq('syntax err.syntax_error
Ok
25writeq(.syntax err.syntax_error
Ok
26'\
''.
syntax err.syntax_error
Ok
210X = 0'\.syntax err.syntax_error
Ok
211X = 0'\. .syntax err.syntax_error
Ok
222writeq((-)-(-)).(-)-(-)(-) - (-)
Ok, extra spacing.
223writeq(((:-):-(:-))).(:-):-(:-)(:-) :- (:-)
Ok, extra spacing.
27writeq((*)=(*)).(*)=(*)(*) = (*)
Ok, extra spacing.
28writeq([:-,-]).[:-,-][:-, -]
Ok, extra spacing.
29writeq(f(*)).f(*)f(*)
Ok
30writeq(a*(b+c)).a*(b+c)a * (b + c)
Ok, extra spacing.
31writeq(f(;,'|',';;')).f(;,'|',';;')f(;, '|', ';;')
Ok, extra spacing.
32writeq([.,.(.,.,.)]).['.','.'('.','.','.')][., .(., ., .)]
Ok, debatable standard interpretation (7.10.5.d).
33writeq((a :- b,c)).a:-b,c a :- b, c
Ok, extra spacing.
34write_canonical([a]).'.'(a,[]) .(a, [])
Ok, debatable standard interpretation (7.10.5.d).
35writeq('/*').'/*''/*'
Ok
203writeq(//*).//*//*
Ok
36writeq('/**').'/**''/**'
Ok
37writeq('*/').*/*/
Ok
38"\'\`\"" = "'`""". % "succeedssucceeds
Ok
179"\'\"" = "'""". % "succeedssucceeds
Ok
178"\`" = "`".succeedssucceeds
Ok
39'\'\`\"' = '''`"'.succeedssucceeds
Ok
40writeq('\'\`\"\"').e.g. '\'`""''\'`""'
Ok
41('\\') = (\).succeedssucceeds
Ok
42op(1,xf,xf1).
1xf1 = xf1(1).
succeedssucceeds
succeeds
Ok
43X = 0X1.syntax err.syntax_error
Ok
44float(.0).syntax err.syntax_error
Ok
45op(100,xfx,.).
functor(3 .2,F,A).
F = ('.'), A = 2.succeeds
F = ., A = 2
Ok
46float(- .0).syntax err.syntax_error
Ok
47float(1E9).syntax err.syntax_error
Ok
48integer(1e).syntax err.syntax_error
Ok
49op(9,xf,e9).
1e9 = e9(1).
succeedssucceeds
succeeds
Ok
50op(9,xf,e).
1e-9 = -(e(1),9).
succeedssucceeds
succeeds
Ok
51 /**/ 1.0e- 9 = -(e(1.0),9).succeedssucceeds
Ok
204 /**/ writeq(1e).e.g. 1 e1 e
Ok
220 /**/ writeq(1.0e).e.g. 1.0 e1.0 e
Ok
52op(9,xfy,e).
1.2e 3 = e(X,Y).
X = 1.2, Y = 3.succeeds
X = 1.2, Y = 3
Ok
53writeq(1.0e100).e.g. 1.0e+1001.0e+100
Ok
54float(1.0ee9).syntax err.syntax_error
Ok
56integer(- 1).succeedssucceeds
Ok
57integer('-'1).succeedssucceeds
Ok
58integer('-' 1).succeedssucceeds
Ok
59integer(- /**/1).succeedssucceeds
Ok
60integer(-/**/1).syntax err.syntax_error
Ok
61integer('-'/**/1).succeedssucceeds
Ok
62atom(-/**/-).succeedssucceeds
Ok
63op(0,fy,-).succeedssucceeds
Ok
180 /**/ integer(-1).succeedssucceeds
Ok
64 /**/ integer(- 1).succeedssucceeds
Ok
135writeq(-(1)).- (1)- (1)
Ok
136op(0,fy,-),writeq(-(1)).-(1)-(1)
Ok
182writeq(-(-1)).- -1- -1
Ok
183writeq(-(1^2)).- (1^2) or - (1)^2- (1) ^ 2
Ok, extra spacing.
260writeq(-(a^2)).-a^2- a ^ 2
Ok, extra spacing.
139writeq(-((a,b))).- (a,b) - (a, b)
Ok, extra spacing.
218writeq(-(1*2)).- (1*2)- (1 * 2)
Ok, extra spacing.
140writeq(-a).-a- a
Ok, extra spacing.
184writeq(-(-)).- (-)- (-)
Ok
185writeq(-[-]).-[-]- [-]
Ok, extra spacing.
188writeq(-p(c)).-p(c)- p(c)
Ok, extra spacing.
189writeq(-{}).-{}-{}
Ok
190writeq(-{a}).-{a} -{a}
Ok
191writeq(-(-a)).- -a.- - a
Ok, extra spacing.
192writeq(-(-(-a))).- - -a.- - - a
Ok, extra spacing.
216writeq(-(-(1))).- - (1)- - (1)
Ok
215op(100,yfx,~).
writeq(-(1~2~3)).
- (1~2~3) or
 - (1)~2~3
succeeds
- (1) ~ 2 ~ 3
Ok, extra spacing.
248 /**/ writeq(- (1~2)).- (1~2) or - (1)~2- (1) ~ 2
Ok, extra spacing.
249 /**/ writeq(1~2).1~21 ~ 2
Ok, extra spacing.
55op(1,yf,yf1).
{-1 yf1}={yf1(X)}.
X = -1.succeeds
X = -1
Ok
65compound(+1).succeeds *succeeds
Ok
66compound(+ 1).succeeds *succeeds
Ok
257writeq([+{a},+[]]).[+{a},+[]][+{a}, + []]
Ok, extra spacing.
67op(0,fy,+).
compound(+1).
syntax err.succeeds

syntax_error
Ok
68[(:-)|(:-)]=[:-|:-].succeedssucceeds
Ok
69X=[a|b,c].syntax err.syntax_error
Ok
70op(1000,xfy,',').p._e.(m.,o.,',')permission_error
Ok
71op(1001,xfy,',').p._e.(m.,o.,',') or
p._e.(c.,o.,',')
permission_error
Ok
72op(999,xfy,'|').p._e.(c., o.,'|') *permission_error
Ok
73 /**/ X=[a|b].X=[a|b].X = [a|b]
Ok
219 /**/ [a|[]]=[a].succeedssucceeds
Ok
74 /**/ X=[a|b|c].syntax err.syntax_error
Ok
75var(a:-b).syntax err.syntax_error
Ok
76:- = :- .syntax err.syntax_error
Ok
77- = - .syntax err.syntax_error
Ok
78* = * .syntax err.syntax_error
Ok
79current_op(200,fy,-).succeedssucceeds
Ok
80current_op(200,fy,+).succeeds *succeeds
Ok
81{- - c}={-(-(c))}.succeedssucceeds
Ok
82(- -) = -(-).syntax err.syntax_error
Ok
83(- - -) = -(-(-)).syntax err.syntax_error
Ok
84(- - - -) = -(-(-(-))).syntax err.syntax_error
Ok
85{:- :- c} = {:-(:-,c)}.syntax err.syntax_error
Ok
86{- = - 1}={(-(=)) - 1}.syntax err.syntax_error
Ok
87write_canonical((- = - 1)).syntax err.syntax_error
Ok
88write_canonical((- = -1)).syntax err.syntax_error
Ok
89write_canonical((-;)).syntax err.syntax_error
Ok
90write_canonical((-;-)).syntax err.syntax_error
Ok
91write_canonical((:-;-)).syntax err.syntax_error
Ok
92[:- -c] = [(:- -c)].syntax err.syntax_error
Ok
93writeq([a,b|,]).syntax err.syntax_error
Ok
94X ={,}.syntax err.syntax_error
Ok
95{1} = {}(1).succeedssucceeds
Ok
96write_canonical({1}).{}(1){}(1)
Ok
97'[]'(1) = [ ](X).X = 1X = 1
Ok
98X = [] (1).syntax err.syntax_error
Ok
99op(100,yfy,op).do._e.(op._s.,yfy)domain_error
Ok
100'''' = '\''.succeedssucceeds
Ok
101a = '\141\'.succeedssucceeds
Ok
102a = '\141'.syntax err.syntax_error
Ok
103X = '\141\141'.X = a141X = a141
Ok
104X = '\9'.syntax err.syntax_error
Ok
105X = '\N'.syntax err.syntax_error
Ok
106X = '\\' .syntax err.syntax_error
Ok
107X = '\77777777777\'.syntax/repr. err.syntax_error
Ok
108a = '\x61\'.succeedssucceeds
Ok
109atom_codes('\xG\',Cs).syntax err./waitssyntax_error
Ok
110atom_codes('\xG1\',Cs).syntax err./waitssyntax_error
Ok
111atom(`).syntax err.syntax_error
Ok
112atom(`+).syntax err.syntax_error
Ok
113X = `a`.syntax err./succ.X = `a`
Ok
114integer(0'\').succeedssucceeds
Ok
115integer(0''').succeedssucceeds
Ok
1160''' = 0'\'.succeedssucceeds
Ok
117integer(0'').syntax err.syntax_error
Ok
195op(100,xf,'').succeedssucceeds
Ok
205 /**/ (0 '') = ''(X).X = 0.X = 0
Ok
196 /**/ writeq(0 '').0'' or 0 ''0 ''
Ok
197 /**/ writeq(0'').0'' or 0 ''0 ''
Ok
118op(100,xfx,'').succeedssucceeds
Ok
119 /**/ functor(0 ''1, F, A).F = (''), A = 2.F = '', A = 2
Ok
120 /**/ functor(0''1, F, A).F = (''), A = 2.F = '', A = 2
Ok
206op(100,xf,f).
writeq(0'f').
syntax err.succeeds

syntax_error
Ok
207 /**/ writeq(0'f'f').e.g. 102 f102 f
Ok
209 /**/ writeq(0'ff).102 f102 f
Ok
256 /**/ writeq(0f).0 f0 f
Ok
208op(100,xf,'f ').
writeq(0 'f ').
0 'f 'succeeds
0 'f '
Ok
121X = 2'1.syntax err.syntax_error
Ok
122op(100,xfx,'1').
functor(2'1'y, F, A).
F = ('1'), A = 2.succeeds
F = '1', A = 2
Ok
262 /**/ functor(2 '1'y, F, A).F = ('1'), A = 2.F = '1', A = 2
Ok
123X =0'\x41\ .X = 65X = 65
Ok
124X =0'\x41\.X = 65X = 65
Ok
125X =0'\x1\.X = 1X = 1
Ok
127X is 16'mod'2.X = 0X = 0
Ok
128X is 37'mod'2.X = 1X = 1
Ok
129X is 0'mod'1.syntax err.syntax_error
Ok
130X is 1'+'1.X = 2X = 2
Ok
212X is 1'\
+'1.
X = 2.X = 2
Ok
213X is 0'\
+'1.
X = 1.X = 1
Ok
259X = 0'\
+'/*'. %*/1.
X = 0+1X = 0 + 1
Ok, extra spacing.
214X is 0'\waitssyntax_error
Ok
126X = 0'\
.
waitssyntax_error
Ok
131op(100,fx,' op').succeedssucceeds
Ok
132 /**/ writeq(' op' '1').' op' '1'' op' '1'
Ok
133 /**/ writeq(' op'[]).' op'[]' op' []
Ok, extra spacing.
134op(1,xf,xf1).
writeq({- =xf1}).
syntax err.succeeds

syntax_error
Ok
137writeq(- (a*b)).- (a*b)- (a * b)
Ok, extra spacing.
138writeq(\ (a*b)).\ (a*b)\ (a * b)
Ok, extra spacing.
141current_op(P,xfy,.).failsfails
Ok
142op(400,xfy,.).succeedssucceeds
Ok
143 /**/ writeq(1 .2).[1|2][1|2]
Ok
144 /**/ writeq([1]).[1][1]
Ok
221 /**/ X = 1.e.X = [1|e].X = [1|e]
Ok
258 /**/ writeq(ok).%
1 = X.
ok X = 1ok
X = 1
Ok
145write_canonical('$VAR'(0)).'$VAR'(0)'$VAR'(0)
Ok
146write_term('$VAR'(0),[]).$VAR(0)$VAR(0)
Ok
244writeq('$VAR'(0)).AA
Ok
245writeq('$VAR'(-1)).'$VAR'(-1)'$VAR'(-1)
Ok
246writeq('$VAR'(-2)).'$VAR'(-2)'$VAR'(-2)
Ok
247writeq('$VAR'(x)).'$VAR'(x)'$VAR'(x)
Ok
147op(9,fy,fy),op(9,yf,yf).
write_canonical(fy 1 yf).
fy(yf(1))succeeds
fy(yf(1))
Ok
148 /**/ write_canonical(fy yf).syntax err.syntax_error
Ok
149 /**/ writeq(fy(yf(1))).fy 1 yffy 1 yf
Ok
150 /**/ writeq(yf(fy(1))).(fy 1)yf(fy 1) yf
Ok, extra spacing.
151op(9,fy,fy),op(9,yfx,yfx).
write_canonical(fy 1 yfx 2).
fy(yfx(1,2))succeeds
fy(yfx(1, 2))
Ok, extra spacing.
152 /**/ writeq(fy(yfx(1,2))).fy 1 yfx 2fy 1 yfx 2
Ok
153 /**/ writeq(yfx(fy(1),2)).(fy 1)yfx 2(fy 1) yfx 2
Ok, extra spacing.
154op(9,yf,yf),op(9,xfy,xfy).
write_canonical(1 xfy 2 yf).
xfy(1,yf(2))succeeds
xfy(1, yf(2))
Ok, extra spacing.
155 /**/ writeq(xfy(1,yf(2))).1 xfy 2 yf1 xfy 2 yf
Ok
156 /**/ writeq(yf(xfy(1,2))).(1 xfy 2)yf(1 xfy 2) yf
Ok, extra spacing.
157op(0,xfy,:-).
current_op(P,xfx,:-).
failssucceeds
fails
Ok
158op(0,xfy,',').p._e.(m.,o.,',')permission_error
Ok
159op(9,fy,f),op(9,yf,f).
write_canonical(f f 0).
f(f(0))succeeds
f(f(0))
Ok
201 /**/ writeq(f(f(0))).e.g. f f 0f f 0
Ok
202 /**/ write_canonical(f 0 f).f(f(0))f(f(0))
Ok
160 /**/ write_canonical(0 f f).f(f(0))f(f(0))
Ok
161 /**/ write_canonical(f f).syntax err.syntax_error
Ok
162op(9,fy,p),op(9,yfx,p).
write_canonical(1 p p p 2).
syntax err.succeeds

syntax_error
Ok
163op(9,fy,p),op(9,xfy,p).
write_canonical(1 p p p 2).
p(1,p(p(2)))succeeds
p(1, p(p(2)))
Ok, extra spacing.
164op(7,fy,p),op(9,yfx,p).
write_canonical(1 p p p 2).
p(1,p(p(2)))succeeds
p(1, p(p(2)))
Ok
165atom('.''-''.').succeedssucceeds
Ok
166op(0,xfy,'|').succeedssucceeds
Ok
167 /**/ writeq((a|b)).syntax err.syntax_error
Ok
168op(9,yf,.).succeedssucceeds
Ok
169 /**/ writeq(.(.)).('.')'.'('.') '.'
Ok, extra spacing.
194writeq((.)+(.)).'.'+'.''.' + '.'
Ok, extra spacing.
170set_prolog_flag(
 double_quotes,chars).
succeedssucceeds
Ok
171 /**/ writeq("a").[a][a]
Ok
229 /**/ writeq("\z").syntax err.syntax_error
Ok
172X is 10.0** -323, writeq(X).e.g. 1.0e-323.9.88131291682493e-324
X = 9.88131291682493e-324
Ok
1731.0e-323=:=10.0** -323.succeedssucceeds
Ok, fails on some machines due to precision.
174-1 = -0x1.succeedssucceeds
Ok
175T = t(0b1,0o1,0x1).T = t(1,1,1)T = t(1, 1, 1)
Ok, extra spacing.
176X is 0b1mod 2.X = 1X = 1
Ok
217op(1105,xfy,'|').succeedssucceeds
Ok
181 /**/ writeq((a-->b,c|d)).a-->b,c|d   * a --> b, c | d
Ok, extra spacing.
186X/* /*/=7.X = 7X = 7
Ok
187X/*/*/=7.X = 7X = 7
Ok
198atom($-).OKsucceeds
Ok
199atom(-$).succeedssucceeds
Ok
200op(900, fy, [$]).
write_canonical($a+b).
$(+(a,b))succeeds
$(+(a, b))
Ok, extra spacing.
224\ .ex._e.(..)existence_error
Ok
225char_code(C,0), writeq(C).'\0\' or rep._e.'\0\'
C = '\0\'
Ok
250writeq('\0\').rep._e. or '\0\''\0\'
Ok
226write_canonical(_+_).e.g. +(_1,_2)+(_13458, _13459)
Ok, extra spacing.
227write_canonical(B+B).e.g. +(_1,_1)+(_14051, _14051)
B = _14051
Ok, extra spacing.
228writeq(0'\z).syntax err.syntax_error
Ok
230char_code('\^',X).syntax err.syntax_error
Ok
231writeq(0'\c).syntax err.syntax_error
Ok
232writeq(0'\ ).syntax err.syntax_error
Ok
233writeq(nop (1)).syntax err.syntax_error
Ok
234op(400,fx,f).
writeq(f/**/(1,2)).
f (1,2)succeeds
f (1, 2)
Ok
235 /**/ writeq(1 = f).syntax err.syntax_error
Ok
236write_canonical(a- - -b).-(a,-(-(b)))-(a, -(-(b)))
Ok, extra spacing.
237op(699,xf,>).p._e.(c.,op,>)permission_error
Ok
238 /**/ writeq(>(>(a),b)).>(a)>b>(a) > b
Ok, extra spacing.
239 /**/ write_canonical(a> >b).syntax err.syntax_error
Ok
242 /**/ write_canonical(a> =b).syntax err.syntax_error
Ok
243 /**/ write_canonical((a>,b)).syntax err.syntax_error
Ok
240 /**/ write_canonical(a>).syntax err.syntax_error
Ok
251op(9,yfx,[bop,bo,b,op,xor]).
writeq(0bop 2).
0 bop 2succeeds
0 bop 2
Ok
263 /**/ writeq(0 bop 2).0 bop 20 bop 2
Ok
252 /**/ writeq(0bo 2).0 bo 20 bo 2
Ok
253 /**/ writeq(0b 2).0 b 20 b 2
Ok
254 /**/ writeq(0op 2).0 op 20 op 2
Ok
255 /**/ writeq(0xor 2).0 xor 20 xor 2
Ok
264writeq('^`').'^`''^`'
Ok
265op(9,yf,[b2,o8]).
writeq(0b2).
0 b2succeeds
0 b2
Ok
267 /**/ writeq(0o8).0 o80 o8
Ok
268op(500, xfy, {}).p._e.(c.,o.,{}) *permission_error
Ok
269writeq('\a\b\r\f\t\n').'\a\b\r\f\t\n''\a\b\r\f\t\n'
Ok
270Finis ().syntax err.syntax_error
Ok