用户输入的格式为a:b> c> d> e ...等等。我想解析输入:(a,>(b,>(c,>(d,e)))是否可能,并有任何建议可以这样做?我用此测试Prolog运算符优先级
prepare:-
op(750,xfx,user:(:)), % change the default priority of : and >
op(700,xfx,user:(>)),
display(a: b > c),%this one worked fine and
%the display value is :(a,>(b,c))
display(a: b > c > d). % I cannot have this works,
%the error ERROR:
%Syntax error:
%Operator priority clash is thrown.
。
输入不能修改任何建议是感激感谢
非常感谢你,把它改成xfy,它工作正常:)。 – temp