[m-users.] delay declarations in Mercury

Matthias Guedemann matthias.guedemann at googlemail.com
Fri Jan 23 19:34:01 AEDT 2015


Hi,

at[1] the authors describe delay declarations as an important feature
for efficient programming in Prolog.

Using SICStus, one can for example write:

,----
| :- block less_than_equal(-,?), less_than_equal(?,-).
| less_than_equal(X,Y) :- X=<Y.
`----

For Mercury, isn't this simply the same as declaring the predicate
less_than_equal/2 with only the following mode?

,----
| :- mode less_than_equal(in, in) is semidet.
`----

If yes, is it in general possible to express the delay declarations in
Mercury using mode declarations?

Best regards,
Matthias

Footnotes: 
[1]  http://www.stups.uni-duesseldorf.de/ProB/index.php5/Why_Prolog%3F



More information about the users mailing list