[m-users.] A more precise determinism checker
zoltan.somogyi at runbox.com
Wed Mar 23 02:05:55 AEDT 2022
2022-03-23 01:47 GMT+11:00 "Dirk Ziegemeyer" <dirk at ziegemeyer.de>:ecker works fine for about 90 percent of my predicates. I wish there would exist some solution to assist Mercury with the remaining 10 percent.
> A pattern that happens very frequently to me: I know exactly that a key is not a member of the keys of a map. Inserting this key into the map under this precondition (with map.insert/4) is of determinism det instead of semidet.
Is there some reason why you cannot call map.det_insert/4 instead of map.insert/4?
It was created for precisely this purpose.
In fact, a large fraction of the semidet predicates in the Mercury standard library
have versions that, like map.det_insert, throw an exception instead of failing.
More information about the users