[m-dev.] for review: polymorphic ground insts [1/3]
David Overton
dmo at cs.mu.OZ.AU
Wed Feb 9 13:42:18 AEDT 2000
Here's the missing log message:
Estimated hours taken: 40
Allow polymorphic ground insts. This change assumes that all inst
parameters in the mode declaration for a predicate or function are
constrained to be ground-shared. This is a temporary measure until we
work out a nice syntax to allow the programmer to tell the compiler that
certain inst parameters may be treated as ground insts. Since we don't
currently support unconstrained inst parameters anyway, this shouldn't
cause a problem.
TODO:
- Add syntax, something like `:- mode p(in(I)) <= ground(I).',
to specify that an inst parameter represents a ground inst.
- Allow abstract ground insts that are treated in a similar
way to what we've done here with ground inst parameters.
compiler/inst.m:
Add a new alternative for ground insts:
`constrained_inst_var(inst_var)'.
Define the type `inst_var_sub'.
compiler/inst_match.m:
Change inst_matches_initial so that it:
- handles constrained_inst_vars correctly;
- returns the inst_var substitutions necessary for the call;
- handles inst_matches_initial(ground(...), bound(...), ...)
properly (this requires knowing the type of the variable).
compiler/hlds_pred.m:
compiler/mode_info.m:
compiler/simplify.m:
Include the inst_varset in the proc_info, mode_info and simplify_info.
Use record syntax for these data structures and their access predicates
to make future changes easier.
compiler/prog_io.m:
When processing pred and func mode declarations, convert all inst_var(V)
insts to ground(shared, constrained_inst_var(V)).
compiler/prog_data.m:
Use inst_vars instead of inst_terms for inst_params.
compiler/modes.m:
compiler/modecheck_call.m:
compiler/unique_modes.m:
compiler/mode_util.m:
When checking or recomputing initial insts of a call, built up
an inst_var substitution (using the modified
inst_matches_initial) and apply this to the final insts of the
called procedure before checking/recomputing them.
compiler/type_util.m:
Add a new predicate, type_util__cons_id_arg_types which
nondeterministically returns the cons_ids and argument types for a
given type.
compiler/accumulator.m:
compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/deforest.m:
compiler/dnf.m:
compiler/follow_code.m:
compiler/higher_order.m:
compiler/inst_util.m:
compiler/lambda.m:
compiler/magic.m:
compiler/magic_util.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
compiler/modecheck_unify.m:
compiler/module_qual.m:
compiler/pd_info.m:
compiler/pd_util.m:
compiler/polymorphism.m:
compiler/post_typecheck.m:
compiler/prog_io_util.m:
compiler/saved_vars.m:
compiler/table_gen.m:
compiler/unify_proc.m:
Pass inst_varsets where needed.
Changes to reflect change in definition of the inst data type.
library/array.m:
library/term.m:
library/io.m:
Temporarily remove the (in, out) versions of some predicates
in the array module since they now match_initial with the
(array_di, array_uo) versions and cause a `duplicate mode
declaration' error. (`array_di' and `array_uo' are not
currently defined as unique modes since unique mode checking
has not been fully implemented yet. Once it has, the (in, out)
modes will need to be put back).
Insert `inst_casts' from `ground' to `uniq_array' in various
places to allow bootstrapping of the library without the
(in, out) modes. These casts can be removed once this change
has bootstrapped.
--
David Overton Department of Computer Science & Software Engineering
PhD Student The University of Melbourne, Australia
+61 3 9344 9159 http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list