tests/hard_coded/*.m:
Update programming style, unless doing so would change
the meaning of the test, in particular:
- use '.' as a module qualifier in place of '__'
- use {write,print}_line where appropriate
- use if-then-else in place of C -> T ; E
- use state variables in place of DCGs
tests/hard_coded/dir_test.m:
Document what the expected outputs correspond to.
Use a uniform module qualifier in the output.
tests/hard_coded/dir_test.exp*:
Conform to the above change.
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: 18
Branches: main
Move the univ, maybe, pair and unit types from std_util into their own
modules. std_util still contains the general purpose higher-order programming
constructs.
library/std_util.m:
Move univ, maybe, pair and unit (plus any other related types
and procedures) into their own modules.
library/maybe.m:
New module. This contains the maybe and maybe_error types and
the associated procedures.
library/pair.m:
New module. This contains the pair type and associated procedures.
library/unit.m:
New module. This contains the types unit/0 and unit/1.
library/univ.m:
New module. This contains the univ type and associated procedures.
library/library.m:
Add the new modules.
library/private_builtin.m:
Update the declaration of the type_ctor_info struct for univ.
runtime/mercury.h:
Update the declaration for the type_ctor_info struct for univ.
runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
Update the definition of MR_Univ.
runtime/mercury_init.h:
Fix a comment: ML_type_name is now exported from type_desc.m.
compiler/mlds_to_il.m:
Update the the name of the module that defines univs (which are
handled specially by the il code generator.)
library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
Conform to the above changes. Import the new modules where they
are needed; don't import std_util where it isn't needed.
Fix formatting in lots of modules. Delete duplicate module
imports.
tests/*:
Update the test suite to confrom to the above changes.
Estimated hours taken: 16
Fix a bug which caused the code generator to fail on certain
examples involving predicates with determinism `erroneous'.
compiler/inst_match.m:
Change `inst_is_bound' so that it succeeds for `not_reached' insts.
This change is so that the behaviour of the predicate matches
the documentation, and so that it is consistent with the behaviour
of `inst_is_ground'.
compiler/liveness.m:
When computing the value-giving occurrences, check explicitly
for unreachable instmaps. This is necessary to handle the above
change to `inst_is_bound'.
Fix a bug in detect_deadness: it was applying the deaths before
the births, but it should be done in the other order.
Normally deaths must be applied before births, but in detect_deadness
we are traversing the goal backwards, so we must apply births first
and then deaths.
The old solution of just cancelling out any vars that occur in
both the post-death and post-birth set was not quite right;
instead we just need to apply them in the correct order.
compiler/code_info.m:
Change the code so that it applies the pre/post deaths
before applying the corresponding births.
compiler/live_vars.m:
compiler/store_alloc.m:
compiler/hlds_goal.m:
Add some comments about making sure we always apply the deaths
before applying the births. (The code here was already correct,
I just added some documentation.)
compiler/hlds_out.m:
Print out the pre/post deaths before the pre/post births, so
that the order that they are printed out in matches the order
in which they should be applied.
tests/hard_coded/Mmake:
tests/hard_coded/erroneous_liveness.m:
tests/hard_coded/erroneous_liveness.exp:
tests/hard_coded/erroneous_liveness.inp:
Regression test for the above-mentioned bug fix.