new diff: hlds_out.m

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 3 00:01:04 AEDT 1998


On 02-Feb-1998, Erwan JAHIER <jahier at cs.mu.OZ.AU> wrote:
> 
> compiler/hlds_out.m
>     This diff  make a few stuffs that where dumped in any
>     hlds-stage optional. They can be recovered using the following
>     field of -D output compiling option:
>     'T' for type and typeclasses information.
>     'M' for modes and instanciation information.
>     'P' for predicates information.
>     'U' for '__unify__' predicates.

The log message (and the documentation) refers to 'P', but the code uses 'C'.
(I think 'C', as you had in the last diff, is better.)
Also 'T' occurs in the log message, but not in the code.


A few minor grammatical points (sorry to be pedantic --- this is
intended as constructive criticism):

	"a few stuffs" should be "a few things" or "some stuff"
	s/instanciation/instantiation/
	s/where/were/

> @@ -433,9 +442,19 @@
>  			% preds), only print them if we are using a local
>  			% mode for them
>  			{ pred_info_is_pseudo_imported(PredInfo) },
> -			{ pred_info_procids(PredInfo, ProcIds) },
> -			{ hlds_pred__in_in_unification_proc_id(ProcId) },
> -			{ ProcIds = [ProcId] }
> +			( { string__contains_char(Verbose, 'U') } ->	    
> +				% We don't really need that information 
> +				% (i.e. unification preds) to
> +				% understand how the program has been 
> +				% transformed. So we dump it only if 
> +				% suboption 'U' is on.
> +
> +				{ pred_info_procids(PredInfo, ProcIds) },
> +				{ hlds_pred__in_in_unification_proc_id(ProcId) },
> +				{ ProcIds = [ProcId] }
> +			;
> +				[]
> +			)
>  		->
>  			[]
>  		;

I think this code is wrong.
Have you tested it?

I think 
	( { string__contains_char(Verbose, 'U') } ->

should be

	( \+ { string__contains_char(Verbose, 'U') } ->


Or, simplifying it a bit, the whole thing should be

		(
			{ pred_info_procids(PredInfo, ProcIds) },
			(
			    % some appropriate comment here
			    { string__contains_char(Verbose, 'U') 
			;
			    % some appropriate comment here
			    { hlds_pred__in_in_unification_proc_id(ProcId) },
			    { ProcIds = [ProcId] }
			}
		->
			[]
		;
			... print it ...
		)

> +++ user_guide.texi	1998/02/02 11:56:32
> @@ -1719,7 +1719,13 @@
>  s - store maps of goals,
>  t - results of termination analysis,
>  u - unification categories,
> -v - variable numbers in variable names.
> +v - variable numbers in variable names,
> +T - type and typeclasses information,
> +M - modes and instanciation information,
> +P - predicates information,
> +U - unify predicates.

That's also not quite grammatically correct.
I suggest

	T - type and typeclass information,
	M - mode and inst information,
	P - predicate information,
	U - unify predicates.

or
	T - type and typeclass information,
	M - mode and inst information,
	C - clauses
	U - unify predicates.

Cheers,
	Fergus.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list