这个问题与first order logic creating terms for arithmetic expressions using prolog直接相关。它目前的结果是8-2+4* -3,怎么可能得到像((8-2)+(4* -3))这样的东西(请注意,它与+(-(8,2),*(4,-3)))不同。- printterm(plus((minus(8,2)),(times(4,3)))).true . 有可能做到这一点吗?
我有与formatting the output with proper paranthesis - Prolog相同的问题,但是解决方案不应该使用!和-->。来自链接的接受答案包含这两个运算符。这个问题与first order logic creating terms for arithmetic expressions using prolog直接相关。它目前的结果是8-2+4* -3,怎么可能得到像((8-2)+(4* -3))这样的东西(请注意,它与+(-(8,2),*(4,-3)))不同。- printterm(plus((