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.
Nr | Input | ISO expected | ECLiPSe 6.1.171 (iso) | Remarks |
---|---|---|---|---|
1 | writeq('\n'). | '\n' | '\n' | Ok |
2 | ' | syntax err. | syntax_error | Ok |
3 | ) | waits | syntax_error | Ok |
261 | ) ' | syntax err. | syntax_error | Ok |
4 | . | syntax err. | syntax_error | Ok |
5 | writeq(' '). % horiz. tab | syntax err. | syntax_error | Ok |
177 | 0'\t=0' . % horiz. tab | syntax err. | syntax_error | Ok |
6 | writeq(' '). | syntax err. | syntax_error | Ok |
7 | writeq('\ '). % "\\\n" | '' | '' | Ok |
8 | writeq('\ a'). % "\\\na" | a | a | Ok |
9 | writeq('a\ b'). % "a\\\nb" | ab | ab | Ok |
10 | writeq('a\ b'). % "a\\\n b" | 'a b' | 'a b' | Ok |
11 | writeq('\ '). | syntax err. | syntax_error | Ok |
193 | writeq('\ '). % "\\ \n" | syntax err. | syntax_error | Ok |
12 | writeq('\ '). % "\\\t" | syntax err. | syntax_error | Ok |
13 | writeq('\t'). | '\t' | '\t' | Ok |
14 | writeq('\a'). | e.g. '\a' | '\a' | Ok |
15 | writeq('\7\'). | e.g. '\a' | '\a' | Ok |
16 | writeq('\ca'). | syntax err. | syntax_error | Ok |
241 | writeq('\d'). | syntax err. | syntax_error | Ok |
17 | writeq('\e'). | syntax err. | syntax_error | Ok |
18 | writeq('\033\'). | e.g. '\33\' | '\33\' | Ok |
19 | char_code('\e',C). | syntax err. | syntax_error | Ok |
21 | char_code('\d',C). | syntax err. | syntax_error | Ok |
22 | writeq('\u1'). | syntax err. | syntax_error | Ok |
23 | X = 0'\u1. | syntax err. | syntax_error | Ok |
24 | writeq(' | syntax err. | syntax_error | Ok |
25 | writeq(. | syntax err. | syntax_error | Ok |
26 | '\ ''. | syntax err. | syntax_error | Ok |
210 | X = 0'\. | syntax err. | syntax_error | Ok |
211 | X = 0'\. . | syntax err. | syntax_error | Ok |
222 | writeq((-)-(-)). | (-)-(-) | (-) - (-) | Ok, extra spacing. |
223 | writeq(((:-):-(:-))). | (:-):-(:-) | (:-) :- (:-) | Ok, extra spacing. |
27 | writeq((*)=(*)). | (*)=(*) | (*) = (*) | Ok, extra spacing. |
28 | writeq([:-,-]). | [:-,-] | [:-, -] | Ok, extra spacing. |
29 | writeq(f(*)). | f(*) | f(*) | Ok |
30 | writeq(a*(b+c)). | a*(b+c) | a * (b + c) | Ok, extra spacing. |
31 | writeq(f(;,'|',';;')). | f(;,'|',';;') | f(;, '|', ';;') | Ok, extra spacing. |
32 | writeq([.,.(.,.,.)]). | ['.','.'('.','.','.')] | [., .(., ., .)] | Ok, debatable standard interpretation (7.10.5.d). |
33 | writeq((a :- b,c)). | a:-b,c | a :- b, c | Ok, extra spacing. |
34 | write_canonical([a]). | '.'(a,[]) | .(a, []) | Ok, debatable standard interpretation (7.10.5.d). |
35 | writeq('/*'). | '/*' | '/*' | Ok |
203 | writeq(//*). | //* | //* | Ok |
36 | writeq('/**'). | '/**' | '/**' | Ok |
37 | writeq('*/'). | */ | */ | Ok |
38 | "\'\`\"" = "'`""". % " | succeeds | succeeds | Ok |
179 | "\'\"" = "'""". % " | succeeds | succeeds | Ok |
178 | "\`" = "`". | succeeds | succeeds | Ok |
39 | '\'\`\"' = '''`"'. | succeeds | succeeds | Ok |
40 | writeq('\'\`\"\"'). | e.g. '\'`""' | '\'`""' | Ok |
41 | ('\\') = (\). | succeeds | succeeds | Ok |
42 | op(1,xf,xf1). 1xf1 = xf1(1). | succeeds | succeeds succeeds | Ok |
43 | X = 0X1. | syntax err. | syntax_error | Ok |
44 | float(.0). | syntax err. | syntax_error | Ok |
45 | op(100,xfx,.). functor(3 .2,F,A). | F = ('.'), A = 2. | succeeds F = ., A = 2 | Ok |
46 | float(- .0). | syntax err. | syntax_error | Ok |
47 | float(1E9). | syntax err. | syntax_error | Ok |
48 | integer(1e). | syntax err. | syntax_error | Ok |
49 | op(9,xf,e9). 1e9 = e9(1). | succeeds | succeeds succeeds | Ok |
50 | op(9,xf,e). 1e-9 = -(e(1),9). | succeeds | succeeds succeeds | Ok |
51 | /**/ 1.0e- 9 = -(e(1.0),9). | succeeds | succeeds | Ok |
204 | /**/ writeq(1e). | e.g. 1 e | 1 e | Ok |
220 | /**/ writeq(1.0e). | e.g. 1.0 e | 1.0 e | Ok |
52 | op(9,xfy,e). 1.2e 3 = e(X,Y). | X = 1.2, Y = 3. | succeeds X = 1.2, Y = 3 | Ok |
53 | writeq(1.0e100). | e.g. 1.0e+100 | 1.0e+100 | Ok |
54 | float(1.0ee9). | syntax err. | syntax_error | Ok |
56 | integer(- 1). | succeeds | succeeds | Ok |
57 | integer('-'1). | succeeds | succeeds | Ok |
58 | integer('-' 1). | succeeds | succeeds | Ok |
59 | integer(- /**/1). | succeeds | succeeds | Ok |
60 | integer(-/**/1). | syntax err. | syntax_error | Ok |
61 | integer('-'/**/1). | succeeds | succeeds | Ok |
62 | atom(-/**/-). | succeeds | succeeds | Ok |
63 | op(0,fy,-). | succeeds | succeeds | Ok |
180 | /**/ integer(-1). | succeeds | succeeds | Ok |
64 | /**/ integer(- 1). | succeeds | succeeds | Ok |
135 | writeq(-(1)). | - (1) | - (1) | Ok |
136 | op(0,fy,-),writeq(-(1)). | -(1) | -(1) | Ok |
182 | writeq(-(-1)). | - -1 | - -1 | Ok |
183 | writeq(-(1^2)). | - (1^2) or - (1)^2 | - (1) ^ 2 | Ok, extra spacing. |
260 | writeq(-(a^2)). | -a^2 | - a ^ 2 | Ok, extra spacing. |
139 | writeq(-((a,b))). | - (a,b) | - (a, b) | Ok, extra spacing. |
218 | writeq(-(1*2)). | - (1*2) | - (1 * 2) | Ok, extra spacing. |
140 | writeq(-a). | -a | - a | Ok, extra spacing. |
184 | writeq(-(-)). | - (-) | - (-) | Ok |
185 | writeq(-[-]). | -[-] | - [-] | Ok, extra spacing. |
188 | writeq(-p(c)). | -p(c) | - p(c) | Ok, extra spacing. |
189 | writeq(-{}). | -{} | -{} | Ok |
190 | writeq(-{a}). | -{a} | -{a} | Ok |
191 | writeq(-(-a)). | - -a. | - - a | Ok, extra spacing. |
192 | writeq(-(-(-a))). | - - -a. | - - - a | Ok, extra spacing. |
216 | writeq(-(-(1))). | - - (1) | - - (1) | Ok |
215 | op(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~2 | 1 ~ 2 | Ok, extra spacing. |
55 | op(1,yf,yf1). {-1 yf1}={yf1(X)}. | X = -1. | succeeds X = -1 | Ok |
65 | compound(+1). | succeeds * | succeeds | Ok |
66 | compound(+ 1). | succeeds * | succeeds | Ok |
257 | writeq([+{a},+[]]). | [+{a},+[]] | [+{a}, + []] | Ok, extra spacing. |
67 | op(0,fy,+). compound(+1). | syntax err. | succeeds syntax_error | Ok |
68 | [(:-)|(:-)]=[:-|:-]. | succeeds | succeeds | Ok |
69 | X=[a|b,c]. | syntax err. | syntax_error | Ok |
70 | op(1000,xfy,','). | p._e.(m.,o.,',') | permission_error | Ok |
71 | op(1001,xfy,','). | p._e.(m.,o.,',') or p._e.(c.,o.,',') | permission_error | Ok |
72 | op(999,xfy,'|'). | p._e.(c., o.,'|') * | permission_error | Ok |
73 | /**/ X=[a|b]. | X=[a|b]. | X = [a|b] | Ok |
219 | /**/ [a|[]]=[a]. | succeeds | succeeds | Ok |
74 | /**/ X=[a|b|c]. | syntax err. | syntax_error | Ok |
75 | var(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 |
79 | current_op(200,fy,-). | succeeds | succeeds | Ok |
80 | current_op(200,fy,+). | succeeds * | succeeds | Ok |
81 | {- - c}={-(-(c))}. | succeeds | succeeds | 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 |
87 | write_canonical((- = - 1)). | syntax err. | syntax_error | Ok |
88 | write_canonical((- = -1)). | syntax err. | syntax_error | Ok |
89 | write_canonical((-;)). | syntax err. | syntax_error | Ok |
90 | write_canonical((-;-)). | syntax err. | syntax_error | Ok |
91 | write_canonical((:-;-)). | syntax err. | syntax_error | Ok |
92 | [:- -c] = [(:- -c)]. | syntax err. | syntax_error | Ok |
93 | writeq([a,b|,]). | syntax err. | syntax_error | Ok |
94 | X ={,}. | syntax err. | syntax_error | Ok |
95 | {1} = {}(1). | succeeds | succeeds | Ok |
96 | write_canonical({1}). | {}(1) | {}(1) | Ok |
97 | '[]'(1) = [ ](X). | X = 1 | X = 1 | Ok |
98 | X = [] (1). | syntax err. | syntax_error | Ok |
99 | op(100,yfy,op). | do._e.(op._s.,yfy) | domain_error | Ok |
100 | '''' = '\''. | succeeds | succeeds | Ok |
101 | a = '\141\'. | succeeds | succeeds | Ok |
102 | a = '\141'. | syntax err. | syntax_error | Ok |
103 | X = '\141\141'. | X = a141 | X = a141 | Ok |
104 | X = '\9'. | syntax err. | syntax_error | Ok |
105 | X = '\N'. | syntax err. | syntax_error | Ok |
106 | X = '\\' . | syntax err. | syntax_error | Ok |
107 | X = '\77777777777\'. | syntax/repr. err. | syntax_error | Ok |
108 | a = '\x61\'. | succeeds | succeeds | Ok |
109 | atom_codes('\xG\',Cs). | syntax err./waits | syntax_error | Ok |
110 | atom_codes('\xG1\',Cs). | syntax err./waits | syntax_error | Ok |
111 | atom(`). | syntax err. | syntax_error | Ok |
112 | atom(`+). | syntax err. | syntax_error | Ok |
113 | X = `a`. | syntax err./succ. | X = `a` | Ok |
114 | integer(0'\'). | succeeds | succeeds | Ok |
115 | integer(0'''). | succeeds | succeeds | Ok |
116 | 0''' = 0'\'. | succeeds | succeeds | Ok |
117 | integer(0''). | syntax err. | syntax_error | Ok |
195 | op(100,xf,''). | succeeds | succeeds | 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 |
118 | op(100,xfx,''). | succeeds | succeeds | 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 |
206 | op(100,xf,f). writeq(0'f'). | syntax err. | succeeds syntax_error | Ok |
207 | /**/ writeq(0'f'f'). | e.g. 102 f | 102 f | Ok |
209 | /**/ writeq(0'ff). | 102 f | 102 f | Ok |
256 | /**/ writeq(0f). | 0 f | 0 f | Ok |
208 | op(100,xf,'f '). writeq(0 'f '). | 0 'f ' | succeeds 0 'f ' | Ok |
121 | X = 2'1. | syntax err. | syntax_error | Ok |
122 | op(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 |
123 | X =0'\x41\ . | X = 65 | X = 65 | Ok |
124 | X =0'\x41\. | X = 65 | X = 65 | Ok |
125 | X =0'\x1\. | X = 1 | X = 1 | Ok |
127 | X is 16'mod'2. | X = 0 | X = 0 | Ok |
128 | X is 37'mod'2. | X = 1 | X = 1 | Ok |
129 | X is 0'mod'1. | syntax err. | syntax_error | Ok |
130 | X is 1'+'1. | X = 2 | X = 2 | Ok |
212 | X is 1'\ +'1. | X = 2. | X = 2 | Ok |
213 | X is 0'\ +'1. | X = 1. | X = 1 | Ok |
259 | X = 0'\ +'/*'. %*/1. | X = 0+1 | X = 0 + 1 | Ok, extra spacing. |
214 | X is 0'\ | waits | syntax_error | Ok |
126 | X = 0'\ . | waits | syntax_error | Ok |
131 | op(100,fx,' op'). | succeeds | succeeds | Ok |
132 | /**/ writeq(' op' '1'). | ' op' '1' | ' op' '1' | Ok |
133 | /**/ writeq(' op'[]). | ' op'[] | ' op' [] | Ok, extra spacing. |
134 | op(1,xf,xf1). writeq({- =xf1}). | syntax err. | succeeds syntax_error | Ok |
137 | writeq(- (a*b)). | - (a*b) | - (a * b) | Ok, extra spacing. |
138 | writeq(\ (a*b)). | \ (a*b) | \ (a * b) | Ok, extra spacing. |
141 | current_op(P,xfy,.). | fails | fails | Ok |
142 | op(400,xfy,.). | succeeds | succeeds | 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 = 1 | ok X = 1 | Ok |
145 | write_canonical('$VAR'(0)). | '$VAR'(0) | '$VAR'(0) | Ok |
146 | write_term('$VAR'(0),[]). | $VAR(0) | $VAR(0) | Ok |
244 | writeq('$VAR'(0)). | A | A | Ok |
245 | writeq('$VAR'(-1)). | '$VAR'(-1) | '$VAR'(-1) | Ok |
246 | writeq('$VAR'(-2)). | '$VAR'(-2) | '$VAR'(-2) | Ok |
247 | writeq('$VAR'(x)). | '$VAR'(x) | '$VAR'(x) | Ok |
147 | op(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 yf | fy 1 yf | Ok |
150 | /**/ writeq(yf(fy(1))). | (fy 1)yf | (fy 1) yf | Ok, extra spacing. |
151 | op(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 2 | fy 1 yfx 2 | Ok |
153 | /**/ writeq(yfx(fy(1),2)). | (fy 1)yfx 2 | (fy 1) yfx 2 | Ok, extra spacing. |
154 | op(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 yf | 1 xfy 2 yf | Ok |
156 | /**/ writeq(yf(xfy(1,2))). | (1 xfy 2)yf | (1 xfy 2) yf | Ok, extra spacing. |
157 | op(0,xfy,:-). current_op(P,xfx,:-). | fails | succeeds fails | Ok |
158 | op(0,xfy,','). | p._e.(m.,o.,',') | permission_error | Ok |
159 | op(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 0 | f 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 |
162 | op(9,fy,p),op(9,yfx,p). write_canonical(1 p p p 2). | syntax err. | succeeds syntax_error | Ok |
163 | op(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. |
164 | op(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 |
165 | atom('.''-''.'). | succeeds | succeeds | Ok |
166 | op(0,xfy,'|'). | succeeds | succeeds | Ok |
167 | /**/ writeq((a|b)). | syntax err. | syntax_error | Ok |
168 | op(9,yf,.). | succeeds | succeeds | Ok |
169 | /**/ writeq(.(.)). | ('.')'.' | ('.') '.' | Ok, extra spacing. |
194 | writeq((.)+(.)). | '.'+'.' | '.' + '.' | Ok, extra spacing. |
170 | set_prolog_flag( double_quotes,chars). | succeeds | succeeds | Ok |
171 | /**/ writeq("a"). | [a] | [a] | Ok |
229 | /**/ writeq("\z"). | syntax err. | syntax_error | Ok |
172 | X is 10.0** -323, writeq(X). | e.g. 1.0e-323. | 9.88131291682493e-324 X = 9.88131291682493e-324 | Ok |
173 | 1.0e-323=:=10.0** -323. | succeeds | succeeds | Ok, fails on some machines due to precision. |
174 | -1 = -0x1. | succeeds | succeeds | Ok |
175 | T = t(0b1,0o1,0x1). | T = t(1,1,1) | T = t(1, 1, 1) | Ok, extra spacing. |
176 | X is 0b1mod 2. | X = 1 | X = 1 | Ok |
217 | op(1105,xfy,'|'). | succeeds | succeeds | Ok |
181 | /**/ writeq((a-->b,c|d)). | a-->b,c|d * | a --> b, c | d | Ok, extra spacing. |
186 | X/* /*/=7. | X = 7 | X = 7 | Ok |
187 | X/*/*/=7. | X = 7 | X = 7 | Ok |
198 | atom($-). | OK | succeeds | Ok |
199 | atom(-$). | succeeds | succeeds | Ok |
200 | op(900, fy, [$]). write_canonical($a+b). | $(+(a,b)) | succeeds $(+(a, b)) | Ok, extra spacing. |
224 | \ . | ex._e.(..) | existence_error | Ok |
225 | char_code(C,0), writeq(C). | '\0\' or rep._e. | '\0\' C = '\0\' | Ok |
250 | writeq('\0\'). | rep._e. or '\0\' | '\0\' | Ok |
226 | write_canonical(_+_). | e.g. +(_1,_2) | +(_13458, _13459) | Ok, extra spacing. |
227 | write_canonical(B+B). | e.g. +(_1,_1) | +(_14051, _14051) B = _14051 | Ok, extra spacing. |
228 | writeq(0'\z). | syntax err. | syntax_error | Ok |
230 | char_code('\^',X). | syntax err. | syntax_error | Ok |
231 | writeq(0'\c). | syntax err. | syntax_error | Ok |
232 | writeq(0'\ ). | syntax err. | syntax_error | Ok |
233 | writeq(nop (1)). | syntax err. | syntax_error | Ok |
234 | op(400,fx,f). writeq(f/**/(1,2)). | f (1,2) | succeeds f (1, 2) | Ok |
235 | /**/ writeq(1 = f). | syntax err. | syntax_error | Ok |
236 | write_canonical(a- - -b). | -(a,-(-(b))) | -(a, -(-(b))) | Ok, extra spacing. |
237 | op(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 |
251 | op(9,yfx,[bop,bo,b,op,xor]). writeq(0bop 2). | 0 bop 2 | succeeds 0 bop 2 | Ok |
263 | /**/ writeq(0 bop 2). | 0 bop 2 | 0 bop 2 | Ok |
252 | /**/ writeq(0bo 2). | 0 bo 2 | 0 bo 2 | Ok |
253 | /**/ writeq(0b 2). | 0 b 2 | 0 b 2 | Ok |
254 | /**/ writeq(0op 2). | 0 op 2 | 0 op 2 | Ok |
255 | /**/ writeq(0xor 2). | 0 xor 2 | 0 xor 2 | Ok |
264 | writeq('^`'). | '^`' | '^`' | Ok |
265 | op(9,yf,[b2,o8]). writeq(0b2). | 0 b2 | succeeds 0 b2 | Ok |
267 | /**/ writeq(0o8). | 0 o8 | 0 o8 | Ok |
268 | op(500, xfy, {}). | p._e.(c.,o.,{}) * | permission_error | Ok |
269 | writeq('\a\b\r\f\t\n'). | '\a\b\r\f\t\n' | '\a\b\r\f\t\n' | Ok |
270 | Finis (). | syntax err. | syntax_error | Ok |