大家好:我想知道为什么这些 derive
语句不具有交换律?
(-> (make-hierarchy)
(derive :b :c)
(derive :a :b)
(derive :a :c))
Execution error (Error) at (<cljs repl>:1).
:a already has :c as ancestor
(-> (make-hierarchy)
(derive :a :c)
(derive :b :c)
(derive :a :b))
{:parents {:a #{:c :b}, :b #{:c}},
:ancestors {:a #{:c :b}, :b #{:c}},
:descendants {:c #{:b :a}, :b #{:a}}}
这两个格言应该同构,但一组语句会导致祖先错误。这种错误的目的是什么?
谢谢!