[m-dev.] handling of impossible insts

Fergus Henderson fjh at cs.mu.oz.au
Thu Aug 14 15:58:04 AEST 1997


Andrew Bromage, you wrote:
> Consider this program (this is the test case for the patch):
> 
> <<
> :- module empty_bound_inst_list.
> 
> :- interface.
> 
> :- pred p is failure.
> 
> :- implementation.
> :- import_module std_util.
> 
> :- type some_functors ---> foo ; bar ; baz.
> 
> p :-
> 	( Y = yes(bar), Z = foo
> 	; Y = yes(baz), Z = foo
> 	),
> 	Y = yes(Z).
> >>
> 
> Without the empty bound_inst list patch, p is classified as being
> semidet.  The bound_inst list patch correctly identifies the final
> unification as having determinism failure.
> 
> However should p/0 be given determinism failure (with the unification
> being replaced with fail by the mode checker in a manner analogous
> to what we currently do with det simple_tests), or should the compiler
> report a mode error?

p/0 should be given determinism failure.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list