[m-rev.] for review: don't remember all modes for non-correct atoms

Ian MacLarty maclarty at cs.mu.OZ.AU
Mon Jan 3 23:59:08 AEDT 2005


For review by anyone.

Estimated hours taken: 0.2
Branches: main

Do not store all modes for inadmissible or erroneous atoms in the declarative
debugger knowledge base, since an atom may be erroneous with respect to one
mode, but inadmissible with respect to another.

browser/declarative_oracle.m
	Only store all modes in the knowledge base when the atom is correct.

Index: browser/declarative_oracle.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_oracle.m,v
retrieving revision 1.29
diff -u -r1.29 declarative_oracle.m
--- browser/declarative_oracle.m	19 Nov 2004 11:54:16 -0000	1.29
+++ browser/declarative_oracle.m	3 Jan 2005 03:30:40 -0000
@@ -573,10 +573,22 @@
 
 assert_oracle_kb(wrong_answer(_, Atom), truth_value(_, Truth), KB0, KB) :-
 	get_kb_ground_map(KB0, Map0),
-	% insert all modes of the predicate/function
-	foldl(add_atom_to_ground_map(Truth, Atom),
-		get_all_modes_for_layout(Atom ^ final_atom ^ proc_layout),
-		Map0, Map),
+	ProcLayout = Atom ^ final_atom ^ proc_layout,
+	%
+	% Insert all modes for the atom if the atom is correct and just the
+	% one mode if it's not correct.  In general we cannot insert all modes
+	% for erroneous or inadmissible atoms since the atom might be
+	% erroneous with respect to one mode, but inadmissible with respect to
+	% another mode.
+	%
+	(
+		Truth = correct
+	->
+		foldl(add_atom_to_ground_map(Truth, Atom),
+			get_all_modes_for_layout(ProcLayout), Map0, Map)
+	;
+		add_atom_to_ground_map(Truth, Atom, ProcLayout, Map0, Map)
+	),
 	set_kb_ground_map(KB0, Map, KB).
 
 assert_oracle_kb(missing_answer(_, Call, _), truth_value(_, Truth), KB0, KB) :-
--------------------------------------------------------------------------
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