use new predicates from library(error) to throw type and domain errors

This commit is contained in:
Markus Triska
2020-04-28 17:34:56 +02:00
parent 97115a9c1c
commit b139620fba
3 changed files with 13 additions and 13 deletions

View File

@@ -22,7 +22,7 @@ random(R) :-
random_integer(Lower, Upper, R) :-
var(R),
( (var(Lower) ; var(Upper)) ->
throw(error(instantiation_error, random_integer/3))
instantiation_error(random_integer/3)
; \+ integer(Lower) ->
domain_error(integer, Lower, random_integer/3)
; \+ integer(Upper) ->