[m-rev.] for review: new mdb command all_procedures

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu Dec 9 11:58:52 AEDT 2004


On 08-Dec-2004, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> >  If the option @samp{-i} or @samp{--print-instance} option is given,
> 
> Remove one "option".

Done in both places.

> >          if (print_mode) {
> > +            if (separate) {
> > +                fprintf(fp, " %ld", (long) uci->MR_uci_mode);
> > +            } else {
> >              fprintf(fp, "-%ld", (long) uci->MR_uci_mode);
> >          }
> 
> The above two lines should be indented.

They already are. The output from diff -b is smaller than the output of diff
without -b, but it leads to artifacts like the one above. I find that a good
tradeoff.

> >  	for (i = 0; i < MR_module_info_next; i++) {
> > -		fprintf(fp, "====================\n");
> > -		fprintf(fp, "module %s\n", MR_module_infos[i]->MR_ml_name);
> > -		fprintf(fp, "====================\n");
> > +		module_name = MR_module_infos[i]->MR_ml_name;
> 
> `module_name' doesn't seem to get used by anything.  How is the module heading now
> printed?

It isn't. The output is easier to process that way. I removed module_name.

Previous to this diff, that function was dead code, so there is no change in
existing functionality.

I used the all_procedures to compute statistics about how many modes predicates
and functions have, by counting occurrences of mode numbers, in response to a
question from a friend of mine. Here are the results:

	func 0: 2837
	func 1: 43
	func 2: 9
	func 3: 4

	average number of modes per function: 1.0197
	percentage of functions with more than one mode: 1.51%

	pred 0: 12256
	pred 1: 308
	pred 2: 110
	pred 3: 95
	pred 4: 51
	pred 5: 38
	pred 6: 5
	pred 7: 3
	pred 8: 1
	pred 9: 1

	average number of modes per predicate: 1.0499
	percentage of predicates with more than one mode: 2.51%

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list