[mercury-users] Compiler optimization for large number of factual clauses.

Bartlomiej Szymczak rhywek at gmail.com
Fri Jun 29 19:48:05 AEST 2007


Hi.

Consider the following Mercury code:

:-type c --->
        c_1;
        c_2;
....(thousands of entries)
        c_99999.

:-pred rel(c,c).
:-mode rel(in,in) is semidet.
:-mode rel(in,out) is nondet.
:-mode rel(out,in) is nondet.

rel(c_1,c_2).
rel(c_1,c_3).
rel(c_3,c_1).
....(thousands of entries)
rel(c_99999,c_3).

I want to ask how fast the "rel" predicate is. Will the compiler
optimize it by adding some hash table based lookup? Are all three
modes equivalently efficient? I need it to work as fast as possible,
as "rel" is called very often in the remaining code.

Any help would be highly appreciated.
-- 
Bartlomiej Antoni Szymczak
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list