[m-rev.] for review: Added trust command to mdb

Ian MacLarty maclarty at cs.mu.OZ.AU
Fri Jun 4 18:28:18 AEST 2004

On 4 Jun 2004, at 14:05, Zoltan Somogyi wrote:
> You should do something about the odd wrapping of the mail you send.
Most new mail clients seem to do this.  I've written a sendmail script 
to send the diff in its original format and I'll use this to post to 
mercury-reviews in the future.

> The log message is too detailed. The point of the log message is to
> give an overview of the change. An overview that is almost as long
> as the diff itself doesn't work very well as an overview. For example
> for declarative_oracle.m, it suffices to say that you add a database
> of trusted modules; the fact that you use it to avoid questions to
> the user is implicit in the meaning of "trust".

Okay I've cut it down.  Some of the stuff isn't totally obvious though 
- like why I changed the query_oracle_kb_list function to 

> I thought we agreed to make atom reference the layout structure 
> instead?
> Why did you go back to this arrangement?
Will be implementing this next time.  Just wanted to get the trust 
functionality done first - as discussed.
> mercury_trace_declarative.h doesn't have any globals *added* to it by
> this diff. What global are you referring to?
The global already exists in mercury_trace_declarative.c (it's called 
MR_trace_front_end_state).  I've removed the reference to the global in 
the overview as it's not really that relevant.
>> +query_oracle_list(OS, [Q | Qs0], As) :-
>> +	query_oracle_list(OS, Qs0, As0),
>> +	Atom = get_decl_question_atom(Q),
>> +	(	
>> +		% is the atom in a trusted module?
>> +		member(Atom ^ module_name, OS ^ trusted_modules)
>> +	->
>> +		As = [truth_value(get_decl_question_node(Q), yes) | As0]
> Replace the second get_decl_question_node(Q) with Atom.
There is no second get_decl_question_node. get_decl_question_atom is 
used for Atom.

>> tests/debugger/declarative/trust.m
>> ===================================================================
>> :- module trust.
>> :- interface.
>> :- import_module trust_1, io.
>> :- pred main(io::di,io::uo) is cc_multi.
>> :- pred blah(w::out) is det.
>> :- implementation.
>> :- import_module trust_2.
>> blah(w("lala")).
>> :- pred dostuff(w::out, comparison_result::uo) is cc_multi.	
>> dostuff(W, R) :-
>> 	compare(R, w("aaB"), w("aAB")),
>> 	concat(w("aaa"),w("bbb"),W).
>> main(!IO) :-
>> 	dostuff(w(S), R),
>> 	write_string(S, !IO),
>> 	nl(!IO),
>> 	write(R, !IO),
>> 	nl(!IO).
> Since blah is local, move the declaration to the implementation 
> section.
I put blah in the interface so I wouldn't get warnings about importing 
trust_1 in the interface and only using it in the implemenation.  
Wanted to check that the trust command still worked no matter where I 
imported the module.
> You probably want to tell the debugger to switch off the display
> of contexts; we already enough test cases to test their display,
> and it clutters up your expected output file.
Okay, but then I also get an extra line "Contexts will not be printed." 
in the output.


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