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, N < 0,
'$do_error'(domain_error(not_less_than_zero, N),succ(M,N)). '$do_error'(domain_error(not_less_than_zero, N),succ(M,N)).
plus(X, Y, Z) : plus(X, Y, Z) :-
( (
var(X) var(X)
> ->
( (
integer(Y), integer(Z) integer(Y), integer(Z)
> ->
'$minus'(Z,Y,X) '$minus'(Z,Y,X)
; ;
'$plus_error'(X,Y,Z) '$plus_error'(X,Y,Z)
) )
; ;
integer(X) integer(X)
> ->
( (
var(Y) var(Y)
> ->
( (
integer(Z) integer(Z)
> ->
'$minus'(Z,X,Y) '$minus'(Z,X,Y)
; ;
'$plus_error'(X,Y,Z) '$plus_error'(X,Y,Z)
) )
; ;
integer(Y) integer(Y)
> ->
( (
integer(Z) integer(Z)
> ->
'$minus'(Z,Y,X) '$minus'(Z,Y,X)
; ;
var(Z) var(Z)
> ->
'$plus'(X,Y,Z) '$plus'(X,Y,Z)
; ;
'$plus_error'(X,Y,Z) '$plus_error'(X,Y,Z)