Fix a test case failure in spf grades.
library/math.m:
Document how the "next integer" operations handle arguments of infinite
magnitude.
tests/general/float_test.m:
s/ceil/ceiling/ in a spot.
Test next integer operations with +/-infinity (and zero).
In the erlang grades, avoid running parts of these tests that
rely on library functionality that is NYI.
Document what the expected outputs correspond to.
tests/general/float_test.exp:
Update this expected output.
tests/general/float_test.exp2:
Replace the contents of this file: previously it contained output for
some ancient version of MSVC; it now contains the spf version of the
output.
tests/general/float_test.exp3:
A new expected output for the erlang grades.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
Estimated hours taken: 0.5
Branches: main
tests/general/float_test.m:
tests/general/float_test.exp:
Uncomment some parts of this test which had previously
been commented out because they didn't work with NU-Prolog.
Estimated hours taken: 1
Branches: main
library/float.m:
library/math.m:
Remove obsolete predicates whose jobs are now done by functions.
The existence of the predicate versions made uses of the functions
ambiguous, as (e.g.) X = math__sin(Y) could be read both as a function
application and as the creation of a closure.
The removed predicates were marked obsolete in March 1999, so there has
been ample notice.
tests/general/float_test.m:
tests/valid/vn_float.m:
Replace the predicate forms with the function forms.
Estimated hours taken: 6
Branches: main
Generate exceptions rather than program aborts for domain errors
and out of bounds array accesses.
Improve the handling of the arithmetic functions.
library/float.m:
library/int.m:
compiler/builtin_ops.m:
Handle division by zero with an exception rather than a
program abort.
Add int__unchecked_quotient and float__unchecked_quotient,
which don't check for division by zero.
Remove reverse modes of the arithmetic functions in float.m.
Richard O'Keefe pointed out a while ago that they don't work
because of rounding errors.
Remove the long obsolete `int__builtin_*' and
`float__builtin_float_*' predicates.
library/math.m:
library/array.m:
Generate exceptions rather than program aborts.
The bounds and domain checks are now implemented in
Mercury, so they do not need to be duplicated for each
target language.
library/exception.m:
Remove predicate throw_string/1, which was used to throw
exceptions from array.m across the C interface, which would
not work in LLDS grades.
NEWS:
Document the changes.
tests/general/float_test.m:
tests/general/string_format_test.m:
tests/hard_coded/ho_solns.m:
tests/hard_coded/ho_univ_to_type.m:
tests/hard_coded/qual_strang.m:
tests/hard_coded/qual_strung.m:
Rename occurrences of `builtin_*'.
Estimated hours taken: 0.5
tests/general:
Add a new test `liveness.m' (which at the moment we do not yet
pass, so the test is not enabled in the Mmake file yet).
Fix the `float_test.m' test so that it uses `%6.3g' rather
than `%6.3f', so that it doesn't complain if the value of
float__max is different in the 16th significant figure.
Also comment out the bits which test math__pi and math__e,
since they are not implemented for NU-Prolog.
float_test.m:
Use string__format to print only the first three digits of
floating point constants, so that rounding errors don't
cause problems when comparing the output from the Mercury
version and the NU-Prolog version.
Also, comment out the parts of the test that don't yet work
because math_rt.mod has no NU-Prolog equivalent.