Try this, did not check. Change Output = Input - 1 to Output is Input - 1. HTH
- Guy Coder
1 Answers
0
votes
You should use is instead of =.
reduceBy1(Input,Output) :-
(Input > 0 -> Output is Input - 1).
?-reduceBy1(5,O).
O = 4
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
Output = Input - 1toOutput is Input - 1. HTH - Guy Coder