[m-users.] Announcement: mercury-rmath library

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Aug 23 18:51:59 AEST 2021


> However, if I use det, then I get these errors:
> 
> : In `get_seed'(out, out, di, uo):
> :   error: determinism declaration not satisfied.
> :   Declared `det', inferred `semidet'.
> :   Call to `rmath.get_seed_impure'(out, out) can fail.
> : In `set_seed'(in, in, di, uo):
> :   error: determinism declaration not satisfied.
> :   Declared `det', inferred `semidet'.
> :   Call to `rmath.set_seed_impure'(in, in) can fail.

You get those errors for the pure predicates wrapped around
the impure predicates because the impure predicates are themselves
semidet. The question is: why are they semidet? I see not reason
why get_seed_impure and set_seed_impure should be semidet.
Indeed, since neither sets the value of SUCCESS_INDICATOR,
they have no way to indicate whether they succeeded or failed anyway. 

Zoltan.


More information about the users mailing list