[m-rev.] For review: bug fix for changes to promise declarations
Lars Yencken
lljy at students.cs.mu.oz.au
Tue Feb 12 15:26:04 AEDT 2002
Hi,
Sorry I didn't run the bootcheck before committing the last change.
Thanks a lot to Simon for doing the temporary workaround. Here's the
proper fix which has been tested and will reenable assertions and the
pretty printing of promise ex declarations.
===================================================================
Estimated hours taken: 6
Branches: main
Fixed the bug where universally quantification was parsed improperly
for assertions.
compiler/prog_io.m:
Fixed the way universal quantificaton is parsed.
Index: prog_io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io.m,v
retrieving revision 1.199
diff -u -b -r1.199 prog_io.m
--- prog_io.m 8 Feb 2002 10:39:47 -0000 1.199
+++ prog_io.m 12 Feb 2002 00:44:08 -0000
@@ -1256,18 +1256,25 @@
maybe1(item)).
:- mode parse_promise(in, in, in, in, in, out) is semidet.
parse_promise(ModuleName, PromiseType, VarSet, [Term], Attributes, Result) :-
+ varset__coerce(VarSet, ProgVarSet0),
+ parse_goal(Term, ProgVarSet0, Goal0, ProgVarSet),
+
% get universally quantified variables
+ ( PromiseType = true ->
+ ( Goal0 = all(UnivVars0, AllGoal) - _Context ->
+ UnivVars0 = UnivVars,
+ Goal = AllGoal
+ ;
+ UnivVars = [],
+ Goal = Goal0
+ )
+ ;
get_quant_vars(univ, ModuleName, Attributes, [], _, UnivVars0),
list__map(term__coerce_var, UnivVars0, UnivVars),
+ Goal0 = Goal
+ ),
- varset__coerce(VarSet, ProgVarSet0),
- parse_goal(Term, ProgVarSet0, PromiseGoal, ProgVarSet),
- % XXX Re-enable this once the handling of quantification has
- % been fixed (spurious unresolved polymorphism warnings
- % are generated when compiling list.m).
- _Result `with_type` maybe1(item) =
- ok(promise(PromiseType, PromiseGoal, ProgVarSet, UnivVars)),
- Result = ok(nothing(no)).
+ Result = ok(promise(PromiseType, Goal, ProgVarSet, UnivVars)).
%-----------------------------------------------------------------------------%
--------------------------------------------------------------------------
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