Pristine Ack-5.5
[Ack-5.5.git] / doc / val.doc
1 .\" $Id: val.doc,v 1.5 1994/06/24 10:02:39 ceriel Exp $
2 .ll 72n
3 .wh 0 hd
4 .wh 60 fo
5 .de hd
6 'sp 5
7 ..
8 .de fo
9 'bp
10 ..
11 .tr ~
12 .               PARAGRAPH
13 .de PP
14 .sp
15 ..
16 .               CHAPTER
17 .de CH
18 .br
19 .ne 15
20 .sp 3
21 .in 0
22 \\fB\\$1\\fR
23 .in 5
24 .PP
25 ..
26 .               SUBCHAPTER
27 .de SH
28 .br
29 .ne 10
30 .sp
31 .in 5
32 \\fB\\$1\\fR
33 .in 10
34 .PP
35 ..
36 .               INDENT START
37 .de IS
38 .sp
39 .in +5
40 ..
41 .               INDENT END
42 .de IE
43 .in -5
44 .sp
45 ..
46 .               DOUBLE INDENT START
47 .de DS
48 .sp
49 .in +5
50 .ll -5
51 ..
52 .               DOUBLE INDENT END
53 .de DE
54 .ll +5
55 .in -5
56 .sp
57 ..
58 .               EQUATION START
59 .de EQ
60 .sp
61 .nf
62 ..
63 .               EQUATION END
64 .de EN
65 .fi
66 .sp
67 ..
68 .               TEST
69 .de TT
70 .ti -5
71 Test~\\$1:~
72 .br
73 ..
74 .               IMPLEMENTATION 1
75 .de I1
76 .br
77 Implementation~1:
78 ..
79 .               IMPLEMENTATION 2
80 .de I2
81 .br
82 Implementation~2:
83 ..
84 .de CS
85 .br
86 ~-~\\
87 ..
88 .br
89 .fi
90 .sp 5
91 .ce
92 \fBPascal Validation Suite Report\fR
93 .CH "Pascal processor identification"
94 The ACK-Pascal compiler produces code for an EM machine
95 as defined in [1].
96 It is up to the implementor of the EM machine whether errors like
97 integer overflow, undefined operand and range bound error are recognized or not.
98 Therefore it depends on the EM machine implementation whether these errors
99 are recognized in Pascal programs or not.
100 The validation suite results of all known implementations are given.
101 .PP
102 There does not (yet) exist a hardware EM machine.
103 Therefore, EM programs must be interpreted, or translated into
104 instructions for a target machine.
105 The following implementations currently exist:
106 .IS
107 .I1
108 an interpreter running on a PDP-11 (using UNIX).
109 The normal mode of operation for this interpreter is to check
110 for undefined integers, overflow, range errors etc.
111 .sp
112 .I2
113 a translator into PDP-11 instructions (using UNIX).
114 Less checks are performed than in the interpreter, because the translator
115 is intended to speed up the execution of well-debugged programs.
116 .IE
117 .CH "Test Conditions"
118 Tester: E.G. Keizer
119 .br
120 Date: October 1983
121 .br
122 Validation Suite version: 3.0
123 .PP
124 The final test run is made with a slightly
125 modified validation suite.
126 .SH "Erroneous programs"
127 Some test did not conform to the standard proposal of February 1979.
128 It is this version of the standard proposal that is used
129 by the authors of the validation suite.
130 .IS
131 .TT 6.6.3.7-4
132 The semicolon between high and integer on line 17 is replaced
133 by a colon.
134 .sp
135 .TT 6.7.2.2-13
136 The div operator on line 14 replaced by mod.
137 .CH "Conformance tests"
138 Number of tests passed = 150
139 .br
140 Number of tests failed = 6
141 .SH "Details of failed tests"
142 .IS
143 .TT 6.1.2-1
144 Character sequences starting with the 8 characters 'procedur'
145 or 'function' are
146 erroneously classified as the word-symbols 'procedure' and 'function'.
147 .sp
148 .TT 6.1.3-2
149 Identifiers identical in the first eight characters, but
150 differing in ninth or higher numbered characters are treated as
151 identical.
152 .sp
153 .TT 6.5.1-1
154 ACK-Pascal requires all formal program parameters to be
155 declared with type \fIfile\fP.
156 .sp
157 .TT 6.6.6.5-1
158 Gives run-time error eof seen at call to eoln.
159 A have a hunch that this is a error in the suit.
160 .sp
161 .TT 6.6.4.1-1
162 Redefining the names of some standard procedures leads to incorrect
163 behaviour of the runtime system.
164 In this case it crashes without a sensible error message.
165 .sp
166 .TT 6.9.3.5.1-1
167 This test can not be translated by our compiler because two
168 non-identical variables are used in the same block with the same first eight
169 characters.
170 The test passed after replacement of one of those names.
171 .IE
172 .CH "Deviance tests"
173 Number of deviations correctly detected = 120
174 .br
175 Number of tests not detecting deviations = 20
176 .SH "Details of deviations"
177 The following tests are compiled without a proper error
178 indication although they do
179 not conform to the standard.
180 .IS
181 .TT 6.1.6-5
182 ACK-Pascal allows labels in the range 0..32767.
183 A warning is produced when testing for deviations from the
184 standard.
185 .sp
186 .TT 6.1.8-5
187 A missing space between a number and a word symbol is not
188 detected.
189 .sp
190 .TT 6.2.2-8
191 .TT 6.3-6
192 .TT 6.4.1-3
193 .TT 6.6.1-3
194 .TT 6.6.1-4
195 Undetected scope error. The scope of an identifier should start at the
196 beginning of the block in which it is declared.
197 In the ACK-Pascal compiler the scope starts just after the declaration,
198 however.
199 .sp
200 .TT 6.4.3.3-7
201 The values of fields from one variant are accessible from
202 another variant.
203 The correlation is exact.
204 .sp
205 .TT 6.6.3.3-4
206 The passing as a variable parameter of the selector of a
207 variant part is not detected.
208 A runtime error is produced because the variant selector is not
209 initialized.
210 .sp
211 .TT 6.8.2.4-2
212 .TT 6.8.2.4-3
213 .TT 6.8.2.4-4
214 .TT 6.8.2.4-5
215 .TT 6.8.2.4-6
216 The ACK-Pascal compiler does not restrict the places from where
217 a jump to a label by means of a goto-statement is allowed.
218 .sp
219 .TT 6.8.3.9-5
220 .TT 6.8.3.9-6
221 .TT 6.8.3.9-7
222 .TT 6.8.3.9-16
223 There are no errors produced for assignments to a variable
224 in use as control-variable of a for-statement.
225 .TT 6.8.3.9-8
226 .TT 6.8.3.9-9
227 Use of a controlled variable after leaving the loop without
228 intervening initialization is not detected.
229 .IE
230 .CH "Error handling"
231 The results depend on the EM implementation.
232 .sp
233 Number of errors correctly detected =
234 .in +5
235 .I1
236 32
237 .I2
238 17
239 .in -5
240 Number of errors not detected =
241 .in +5
242 .I1
243 21
244 .I2
245 36
246 .in -5
247 Number of errors incorrectly detected =
248 .in +5
249 .I1
250 2
251 .I2
252 2
253 .in -5
254 .SH "Details of errors not detected"
255 The following test fails because the ACK-Pascal compiler only
256 generates a warning that does not prevent to run the tests.
257 .IS
258 .TT 6.6.2-8
259 A warning is produced if there is no assignment to a function-identifier.
260 .IE
261 With this test the ACK-Pascal compiler issues an error message for a legal
262 construct not directly related to the error to be detected.
263 .IS
264 .TT 6.5.5-2
265 Program does not compile.
266 Buffer variable of text file is not allowed as variable
267 parameter.
268 .IE
269 The following errors are not detected at all.
270 .IS
271 .TT 6.2.1-11
272 .I2
273 The use of an undefined integer is not caught as an error.
274 .sp
275 .TT 6.4.3.3-10
276 .TT 6.4.3.3-11
277 .TT 6.4.3.3-12
278 .TT 6.4.3.3-13
279 The notion of 'current variant' is not implemented, not even if a tagfield
280 is present.
281 .sp
282 .TT 6.4.5-15
283 .TT 6.4.6-9
284 .TT 6.4.6-10
285 .TT 6.4.6-11
286 .TT 6.5.3.2-2
287 .I2
288 Subrange bounds are not checked.
289 .sp
290 .TT 6.4.6-12
291 .TT 6.4.6-13
292 .TT 6.7.2.4-4
293 If the base-type of a set is a subrange, then the set elements are not checked
294 against the bounds of the subrange.
295 Only the host-type of this subrange-type is relevant for ACK-Pascal.
296 .sp
297 .TT 6.5.4-1
298 .I2
299 Nil pointers are not detected.
300 .sp
301 .TT 6.5.4-2
302 .I2
303 Undefined pointers are not detected.
304 .sp
305 .TT 6.5.5-3
306 Changing the file position while the window is in use as actual variable
307 parameter or as an element of the record variable list of a with-statement
308 is not detected.
309 .sp
310 .TT 6.6.2-9
311 An undefined function result is not detected,
312 because it is never used in an expression.
313 .sp
314 .TT 6.6.5.3-6
315 .TT 6.6.5.3-7
316 Disposing a variable while it is in use as actual variable parameter or
317 as an element of the record variable list of a with-statement is not detected.
318 .sp
319 .TT 6.6.5.3-8
320 .TT 6.6.5.3-9
321 .TT 6.6.5.3-10
322 It is not detected that a record variable, created with the variant form
323 of new, is used as an operand in an expression or as the variable in an
324 assignment or as an actual value parameter.
325 .sp
326 .TT 6.6.5.3-11
327 Use of a variable that is not reinitialized after a dispose is
328 not detected.
329 .sp
330 .TT 6.6.6.4-4
331 .TT 6.6.6.4-5
332 .TT 6.6.6.4-7
333 .I2
334 There are no range checks for pred, succ and chr.
335 .sp
336 .TT 6.6.6.5-6
337 ACK-Pascal considers a rewrite of a file as a defining
338 occurence.
339 .sp
340 .TT 6.7.2.2-8
341 .TT 6.7.2.2-9
342 .TT 6.7.2.2-10
343 .TT 6.7.2.2-12
344 .I2
345 Division by 0 or integer overflow is not detected.
346 .sp
347 .TT 6.8.3.9-18
348 The use of the some control variable in two nested for
349 statements in not detected.
350 .sp
351 .TT 6.8.3.9-19
352 Access of a control variable after leaving the loop results in
353 the final-value, although an error should be produced.
354 .sp
355 .TT 6.9.3.2-3
356 The program stops with a file not open error.
357 The rewrite before the write is missing in the program.
358 .sp
359 .TT 6.9.3.2-4
360 .TT 6.9.3.2-5
361 Illegal FracDigits values are not detected.
362 .CH "Implementation dependence"
363 Number of tests run = 14
364 .br
365 Number of tests incorrectly handled = 0
366 .SH "Details of implementation dependence"
367 .IS
368 .TT 6.1.9-5
369 Alternate comment delimiters are implemented
370 .sp
371 .TT 6.1.9-6
372 The equivalent symbols @ for ^, (. for [ and .) for ] are not
373 implemented.
374 .sp
375 .TT 6.4.2.2-10
376 Maxint = 32767
377 .sp
378 .TT 6.4.3.4-5
379 Only elements with non-negative ordinal value are allowed in sets.
380 .sp
381 .TT 6.6.6.1-1
382 Standard procedures and functions are not allowed as parameters.
383 .sp
384 .TT 6.6.6.2-11
385 Details of the machine characteristics regarding real numbers:
386 .IS
387 .nf
388 beta =       2
389 t =         56
390 rnd =        1
391 ngrd =       0
392 machep =   -56
393 negep =    -56
394 iexp =       8
395 minexp =  -128
396 maxexp =   127
397 eps =     1.387779e-17
398 epsneg =  1.387779e-17
399 xmin =    2.938736e-39
400 xmax =    1.701412e+38
401 .fi
402 .IE
403 .sp
404 .TT 6.7.2.3-3
405 .TT 6.7.2.3-4
406 All operands of boolean expressions are evaluated.
407 .sp
408 .TT 6.8.2.2-1
409 .TT 6.8.2.2-2
410 The expression in an assignment statement is evaluated
411 before the variable selection if this involves pointer
412 dereferencing or array indexing.
413 .sp
414 .TT 6.8.2.3-2
415 Actual parameters are evaluated in reverse order.
416 .sp
417 .TT 6.9.3.2-6
418 The default width for integer, Boolean and real are 6, 5 and 13.
419 .sp
420 .TT 6.9.3.5.1-2
421 The number of digits written in an exponent is 2.
422 .sp
423 .TT 6.9.3.6-1
424 The representations of true and false are (~true) and (false).
425 The parenthesis serve to indicate width.
426 .IE
427 .CH "Quality measurement"
428 Number of tests run = 60
429 .br
430 Number of tests handled incorrectly = 1
431 .SH "Results of tests"
432 Several test perform operations on reals on indicate the error
433 introduced by these operations.
434 For each of these tests the following two quality measures are extracted:
435 .sp
436 .in +5
437 maxRE:~~maximum relative error
438 .br
439 rmsRE:~~root-mean-square relative error
440 .in -5
441 .sp 2
442 .IS
443 .TT 1.2-1
444 .I1
445 25 thousand Whetstone instructions per second.
446 .I2
447 169 thousand Whetstone instructions per second.
448 .sp
449 .TT 1.2-2
450 The value of (TRUEACC-ACC)*2^56/100000 is 1.4 .
451 This is well within the bounds specified in [3].
452 .br
453 The GAMM measure is:
454 .I1
455 238 microseconds
456 .I2
457 26.3 microseconds.
458 .sp
459 .TT 1.2-3
460 The number of procedure calls calculated in this test exceeds
461 the maximum integer value.
462 The program stops indicating overflow.
463 .sp
464 .TT 6.1.3-3
465 The number of significant characters for identifiers is 8.
466 .sp
467 .TT 6.1.5-8
468 There is no maximum to the line length.
469 .sp
470 .TT 6.1.5-9
471 The error message "too many digits" is given for numbers larger
472 than maxint.
473 .sp
474 .TT 6.1.5-10
475 .TT 6.1.5-11
476 .TT 6.1.5-12
477 Normal values are allowed for real constants and variables.
478 .sp
479 .TT 6.1.7-14
480 A reasonably large number of strings is allowed.
481 .sp
482 .TT 6.1.8-6
483 No warning is given for possibly unclosed comments.
484 .sp
485 .TT 6.2.1-12
486 .TT 6.2.1-13
487 .TT 6.2.1-14
488 .TT 6.2.1-15
489 .TT 6.5.1-2
490 Large lists of declarations are possible in each block.
491 .sp
492 .TT 6.4.3.2-6
493 An 'array[integer] of' is not allowed.
494 .sp
495 .TT 6.4.3.2-7
496 .TT 6.4.3.2-8
497 Large values are allowed for arrays and indices.
498 .sp
499 .TT 6.4.3.3-14
500 Large amounts of case-constant values are allowed in variants.
501 .sp
502 .TT 6.4.3.3-15
503 Large amounts of record sections can appear in the fixed part of
504 a record.
505 .sp
506 .TT 6.4.3.3-16
507 Large amounts of variants are allowed in a record.
508 .TT 6.4.3.4-4
509 Size and speed of Warshall's algorithm depend on the
510 implementation of EM:
511 .IS
512 .I1
513 .br
514 size: 122 bytes
515 .br
516 speed: 5.2 seconds
517 .sp
518 .I2
519 .br
520 size: 196 bytes
521 .br
522 speed: 0.7 seconds
523 .IE
524 .TT 6.5.3.2-3
525 Deep nesting of array indices is allowed.
526 .sp
527 .TT 6.5.3.2-4
528 .TT 6.5.3.2-5
529 Arrays can have at least 8 dimensions.
530 .sp
531 .TT 6.6.1-8
532 Deep static nesting of procedure is allowed.
533 .sp
534 .TT 6.6.3.1-6
535 Large amounts of formal parameters are allowed.
536 .sp
537 .TT 6.6.5.3-12
538 Dispose is fully implemented.
539 .sp
540 .TT 6.6.6.2-6
541 Test sqrt(x): no errors.
542 The error is within acceptable bounds.
543 .in +5
544 maxRE:~~2~**~-55.50
545 .br
546 rmsRE:~~2~**~-57.53
547 .in -5
548 .sp
549 .TT 6.6.6.2-7
550 Test arctan(x): may cause underflow or overflow errors.
551 The error is within acceptable bounds.
552 .in +5
553 .br
554 maxRE:~~2~**~-55.00
555 .br
556 rmsRE:~~2~**~-56.36
557 .in -5
558 .sp
559 .TT 6.6.6.2-8
560 Test exp(x): may cause underflow or overflow errors.
561 The error is not within acceptable bounds.
562 .in +5
563 maxRE:~~2~**~-50.03
564 .br
565 rmsRE:~~2~**~-51.03
566 .in -5
567 .sp
568 .TT 6.6.6.2-9
569 Test sin(x): may cause underflow errors.
570 The error is not within acceptable bounds.
571 .in +5
572 maxRE:~~2~**~-38.20
573 .br
574 rmsRE:~~2~**~-43.68
575 .in -5
576 .sp
577 Test cos(x): may cause underflow errors.
578 The error is not within acceptable bounds.
579 .in +5
580 maxRE:~~2~**~-41.33
581 .br
582 rmsRE:~~2~**~-46.62
583 .in -5
584 .sp
585 .TT 6.6.6.2-10
586 Test ln(x):
587 The error is not within acceptable bounds.
588 .in +5
589 maxRE:~~2~**~-54.05
590 .br
591 rmsRE:~~2~**~-55.77
592 .in -5
593 .sp
594 .TT 6.7.1-3
595 .TT 6.7.1-4
596 .TT 6.7.1-5
597 Complex nested expressions are allowed.
598 .sp
599 .TT 6.7.2.2-14
600 Test real division:
601 The error is within acceptable bounds.
602 .in +5
603 maxRE:~~0
604 .br
605 rmsRE:~~0
606 .in -5
607 .sp
608 .TT 6.7.2.2-15
609 Operations of reals in the integer range are exact.
610 .sp
611 .TT 6.7.3-1
612 .TT 6.8.3.2-1
613 .TT 6.8.3.4-2
614 .TT 6.8.3.5-15
615 .TT 6.8.3.7-4
616 .TT 6.8.3.8-3
617 .TT 6.8.3.9-20
618 .TT 6.8.3.10-7
619 Static deep nesting of function calls,
620 compound statements, if statements, case statements, repeat
621 loops, while loops, for loops and with statements is possible.
622 .sp
623 .TT 6.8.3.2-2
624 Large amounts of statements are allowed in a compound
625 statement.
626 .sp
627 .TT 6.8.3.5-12
628 The compiler requires case constants to be compatible with
629 the case selector.
630 .sp
631 .TT 6.8.3.5-13
632 .TT 6.8.3.5-14
633 Large case statements are possible.
634 .sp
635 .TT 6.9-2
636 Recursive IO on the same file is well-behaved.
637 .sp
638 .TT 6.9.1-6
639 The reading of real values from a text file is done with
640 sufficient accuracy.
641 .in +5
642 maxRE:~~2~**~-54.61
643 .br
644 rmsRE:~~2~**~-56.32
645 .in -5
646 .sp
647 .TT 6.9.1-7
648 .TT 6.9.2-2
649 .TT 6.9.3-3
650 .TT 6.9.4-2
651 Read, readln, write and writeln may have large amounts of
652 parameters.
653 .sp
654 .TT 6.9.1-8
655 The loss of precision for reals written on a text file and read
656 back is:
657 .in +5
658 maxRE:~~2~**~-53.95
659 .br
660 rmsRE:~~2~**~-55.90
661 .in -5
662 .sp
663 .TT 6.9.3-2
664 File IO buffers without trailing marker are correctly flushed.
665 .sp
666 .TT 6.9.3.5.2-2
667 Reals are written with sufficient accuracy.
668 .in +5
669 maxRE:~~0
670 .br
671 rmsRE:~~0
672 .in -5
673 .IE
674 .CH "Level 1 conformance tests"
675 Number of test passed = 4
676 .br
677 Number of tests failed = 1
678 .SH "Details of failed tests"
679 .IS
680 .TT 6.6.3.7-4
681 An expression indicated by parenthesis whose
682 value is a conformant array is not allowed.
683 .IE
684 .CH "Level 1 deviance tests"
685 Number of deviations correctly detected = 4
686 .br
687 Number of tests not detecting deviations = 0
688 .IE
689 .CH "Level 1 error handling"
690 The results depend on the EM implementation.
691 .sp
692 Number of errors correctly detected =
693 .in +5
694 .I1
695 1
696 .I2
697 0
698 .in -5
699 Number of errors not detected =
700 .in +5
701 .I1
702 0
703 .I2
704 1
705 .in -5
706 .SH "Details of errors not detected"
707 .IS
708 .TT 6.6.3.7-9
709 .I2
710 Subrange bounds are not checked.
711 .IE
712 .CH "Level 1 quality measurement"
713 Number of tests run = 1
714 .SH "Results of test"
715 .IS
716 .TT 6.6.3.7-10
717 Large conformant arrays are allowed.
718 .IE
719 .CH "Extensions"
720 Number of tests run = 3
721 .SH Details of test failed
722 .IS
723 .TT 6.1.9-7
724 The alternative relational operators are not allowed.
725 .sp
726 .TT 6.1.9-8
727 The alternative symbols for colon, semicolon and assignment are
728 not allowed.
729 .sp
730 .TT 6.8.3.5-16
731 The otherwise selector in case statements is not allowed.
732 .IE
733 .CH "References"
734 .ti -5
735 [1]~~\
736 A.S.Tanenbaum, E.G.Keizer, J.W.Stevenson, Hans van Staveren,
737 "Description of a machine architecture for use with block structured
738 languages",
739 Informatica rapport IR-81.
740 .ti -5
741 [2]~~\
742 ISO standard proposal ISO/TC97/SC5-N462, dated February 1979.
743 The same proposal, in slightly modified form, can be found in:
744 A.M.Addyman e.a., "A draft description of Pascal",
745 Software, practice and experience, May 1979.
746 An improved version, received March 1980,
747 is followed as much as possible for the
748 current ACK-Pascal.
749 .ti -5
750 [3]~~\
751 B. A. Wichman and J du Croz,
752 A program to calculate the GAMM measure, Computer Journal,
753 November 1979.