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.
我试图简单地在序言中做一个这样的条件:
((生命==死亡)->反式=否)。
我认为上面的代码会评估为好像 Life == dead,然后 Trans = no,但由于某种原因它不是?谢谢。
为我工作:
?- ((Life==dead)->Trans=no). false. ?- Life = dead, ((Life == dead) -> Trans=no). Life = dead, Trans = no.
Life == dead 只有在 Life 已经注定要死的情况下才会成立。
此外,这是一个相当奇怪的结构,在实践中很少需要它, (x -> y ; z) 更为常见。