[m-dev.] [reuse] diff: same_cons_id constraint bug fix

Peter Ross petdr at miscrit.be
Tue Oct 17 04:26:55 AEDT 2000


Hi,


===================================================================


Estimated hours taken: 1

sr_choice.m:
    Fix a bug where the same cons_id can be inserted into the multi_map
    twice.  Before constraining to the same_cons_id remove all
    duplicates from the list of consids.

Index: sr_choice.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_choice.m,v
retrieving revision 1.1.2.10
diff -u -r1.1.2.10 sr_choice.m
--- sr_choice.m	2000/10/12 21:14:20	1.1.2.10
+++ sr_choice.m	2000/10/16 17:23:50
@@ -194,7 +194,8 @@
 		{ P = (pred(Candidate::out) is nondet :- 
 			list__member(Candidate, PossibleCandidates),
 			CandidateVar = fst(Candidate),
-			multi_map__search(Map, CandidateVar, [ConsId])
+			multi_map__search(Map, CandidateVar, ConsIds),
+			list__remove_dups(ConsIds, [ConsId])
 		)}
 	;
 		{ Constraint = within_n_cells_difference(Difference) },
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list