[m-rev.] for review: restore writing promises to .opt files

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Jul 10 17:14:12 AEST 2012


On Tue, 10 Jul 2012, Peter Wang wrote:

> Branches: main
>
> Restore writing promises to `.opt' files.
>
> Also some cosmetic changes relating to promises.
>
> compiler/intermod.m:
> 	Predicates representing promises have the `infer_modes' flag set
> 	(not actually necessary), causing promises not to be written out to
> 	`.opt' files.  Add an exception for promises.
>
> 	Improve code style.
>
> compiler/add_clause.m:
> 	Add a comment about the `infer_modes' flag.
>
> compiler/assertion.m:
> 	Use a shared predicate in `record_preds_used_in' and add a sanity
> 	check.
>
> 	Improve code style.
>
> compiler/hlds_out_util.m:
> 	Use the location of a promise declaration in `pred_id_to_string'.
>
> compiler/hlds_pred.m:
> 	Add a helper predicate `pred_info_is_promise'.
>
> 	Put `is_unify_or_compare_pred' in the same relative position as
> 	its declaration.
>
> compiler/dead_proc_elim.m:
> compiler/hlds_error_util.m:
> compiler/typecheck.m:
> 	Use `pred_info_is_promise'.
>
> doc/reference_manual.texi:
> 	Update some commented-out out documentation.
>
> diff --git a/compiler/add_clause.m b/compiler/add_clause.m
> index fb77dc0..6e9bded 100644
> --- a/compiler/add_clause.m
> +++ b/compiler/add_clause.m
> @@ -257,6 +257,8 @@ module_add_clause(ClauseVarSet, PredOrFunc, PredName, Args0, Body, Status,
>
>                 % Check if there are still no modes for the predicate, and
>                 % if so, set the `infer_modes' flag for that predicate.
> +                % (Predicates representing promises do not need mode inference
> +                % so the flag could be omitted for them.)

So why not omit it then?

The rest looke fine -- the reference manual will probably need some
revision prior to the chapter on promises being uncommented.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list