[mercury-users] Fact tables

Michael Day mikeday at yeslogic.com
Fri Jul 18 12:15:22 AEST 2003


Hi,

To represent a relation that maps some ints to some other ints, which
would be the best Mercury implementation:

:- pred encoding(int, int).
:- mode encoding(in, out) is semidet.

:- pred encoding(int, maybe(int)).
:- mode encoding(in, out) is det.

:- pred encoding(int, int).		% returns -1 on failure (ugh)
:- mode encoding(in, out) is det.

The input does not form a contiguous range (although it may form multiple
independent contiguous ranges).

Would using the fact_table pragma affect the implementation, or just the
compilation speed? (presumably it would rule out using maybe(int)).

Thanks,

Michael

-- 
YesLogic Prince prints XML!
http://yeslogic.com

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list