Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 prolog 新手,有一个菜鸟问题:
假设我有这些代码行:
p(1). p(2):-!. p(3).
我正在跑步p(X)。
p(X)
问题:我得到X=1 , X=2. 为什么不X等于3呢?
X=1 , X=2
X
3
the cut "!" is executed before p(3)... that is why it does not display X=3...