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

Mark Clements (gmail) samuel.legotus at gmail.com
Mon Aug 23 19:24:37 AEST 2021


I have now declared those predicates as being det.

Some caveats: first, the README describes the library as being of alpha 
quality. There are no checks on whether the C calls were successful or 
not - actually, the Rmath library does not provide any return codes, 
which is consistent with some other math libraries, such as Cephes and, 
to an extent, GSL. Second, the GPL licence may not be friendly to some 
applications.

-- Mark

On 23/08/2021 10:51, Zoltan Somogyi wrote:
>> 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