Arithmetic onlyworks forward in Prolog
sum(X,Y,Z) :- Z is X + Y.
?- sum(4,5,Z). Z=9
?- sum(4,Y,9). Error!
We’ll come back to this in CLP(R), which can do it both ways!
Previous slide
Next slide
Back to first slide
View graphic version