[m-dev.] for review: improvements/bug fixes for simplify.m

Simon Taylor stayl at cs.mu.OZ.AU
Tue Oct 26 14:25:10 AEST 1999


 
> I just had a look, and it turns out that there is only one other
> call to type_util__get_cons_id_arg_types.  That call is in
> goal_util__case_to_disjunct, which is called only from
> goal_util__switch_to_disjunction, which in turn is called only from
> magic.m, which is used only by the Aditi interface.  So, does the Aditi
> interface support existential types?  What will happen if you try to
> write code using existential types and compile it to Aditi-RL?

Aditi doesn't support polymorphism at all. I'll have to change the code
to report an error if a type used in an Aditi predicate has
existentially typed constructors.

> >  simplify__goal_2(some(Vars1, CanRemove0, Goal1), SomeInfo,
> > +		GoalExpr, GoalInfo, Info0, Info) :-
> > +	simplify_info_get_common_info(Info0, Common),
> > +	simplify__goal(Goal1, Goal2, Info0, Info1),
> > +	simplify__nested_somes(CanRemove0, Vars1, Goal2, SomeInfo, Goal),
> > +	Goal = GoalExpr - GoalInfo,
> > +	( Goal = some(_, _, _) - _ ->
> > +		% Don't increase the set of non-locals of a goal within
> > +		% a commit through common structure elimination because
> > +		% that may change the determinism.
> > +		simplify_info_set_common_info(Info1, Common, Info)
> >  	;
> > +		Info = Info1
> >  	).

> Also, isn't that test a little conservative?
> Not every `some' is a commit.
> If the goal already has output variables, then increasing
> the set of non-locals won't change the determinism, will it?

`simplify__nested_somes' removes quantifications that aren't commits.

Simon.
--------------------------------------------------------------------------
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