Prolog recrusive Algorithm
问题 foo(0,Y,Z) :- Z is Y. foo(X,0,Z) :- Z is X. foo(X,Y,Z) :- X>=Y, M1 is X-2, foo(M1, Y, Zx), Z is Zx + Y. foo(X,Y,Z) :- Y<X, N1 is Y-3, foo(X, N1, Zx), Z is Zx + X. So this is my program and this is what i'm trying to accomplish 𝑓𝑜𝑜(𝑥, 𝑦) = { 𝑥 𝑖𝑓 𝑦 ≤ 0 𝑦 𝑖𝑓 𝑥 ≤ 0 𝑥 + 𝑓𝑜𝑜(𝑥 − 2, 𝑦) 𝑖𝑓 𝑥 ≥ 𝑦 𝑦 + 𝑓𝑜𝑜(𝑥, 𝑦 − 3) 𝑖𝑓 𝑥 < 𝑦 } Why does my program not output anything? This is what i think i'm saying - If X = 0, foo(0,Y,Z), than return Z as Y. If Y = 0, foo(0,Y,Z), than return Z as X. if X>=Y, than do