0
我得到了太多的結果。怎麼了?在prolog中剪切結果不存在?找到最大的樹
(deffacts mytree
(below birch poplar)
(above linden maple)
(below pine fir)
(below linden birch)
(above pine poplar))
(defrule high-low-tree
(below ?tree1 ?tree2)
(not (above ?tree1 ?tree2))
(or (above ?tree2 ?tree1)
(not (above ?tree2 ?tree1)))
=>
(printout t "The tallest tree " ?tree2 crlf)
(printout t "The lowest tree " ?tree1 crlf))
太好了!謝謝你,先生。 –