fix plus/3 fix

This commit is contained in:
Vítor Santos Costa 2010-05-04 16:37:03 +01:00
parent 02459e7bec
commit 4e39da0531

View File

@ -399,40 +399,40 @@ succ(M,N) :-
N < 0,
'$do_error'(domain_error(not_less_than_zero, N),succ(M,N)).
plus(X, Y, Z) :
plus(X, Y, Z) :-
(
var(X)
>
->
(
integer(Y), integer(Z)
>
->
'$minus'(Z,Y,X)
;
'$plus_error'(X,Y,Z)
)
;
integer(X)
>
->
(
var(Y)
>
->
(
integer(Z)
>
->
'$minus'(Z,X,Y)
;
'$plus_error'(X,Y,Z)
)
;
integer(Y)
>
->
(
integer(Z)
>
->
'$minus'(Z,Y,X)
;
var(Z)
>
->
'$plus'(X,Y,Z)
;
'$plus_error'(X,Y,Z)