opennars / Narjure

A Clojure implementation of the Non-Axiomatic Reasoning System proposed by Pei Wang.
GNU General Public License v2.0
44 stars 11 forks source link

Truth/Desire Function argument swapping for swapped rules. #27

Closed patham9 closed 8 years ago

patham9 commented 8 years ago

As we know from the rule A, B |- C we can (according to our conditions) sometimes derived B, A |- C this also seems to be done already, however altough the premises are swapped, the arguments of the truth function are not, causing mistakes.

rasom commented 8 years ago

@patham9, can you give some specific example of rule that derives wrong results?

rasom commented 8 years ago

https://gist.github.com/rasom/dc1ef3fd00509b35781502d7c58784bd https://gist.github.com/rasom/3f9ec4fa906fdc2d42ffd25083d300b0

Which conclusions are wrong in these examples ?

patham9 commented 8 years ago
(deftest nal1-inheritance-related-syllogisms-abduction
  (is (derived "<sport --> competition>."
               "<chess --> competition>. %0.90;0.90%"
               ["<sport --> chess>. %1.00;0.42%"
                "<chess --> sport>. %0.90;0.45%"]))

it uses the same truth value altough the second case is the swapped case, where as I said, the truth function arguments are not swapped also, and thus it fails the test.

patham9 commented 8 years ago
(conclusions "<sport --> competition>." "<chess --> competition>. %0.90;0.90%")
=>
#{{:statement [--> chess sport], :task-type :belief, :occurrence 0, :truth [0.9 0.44751381215469616]}
  {:statement [--> sport chess], :task-type :belief, :occurrence 0, :truth [0.9 0.44751381215469616]}
  ...}

See? Same truth value, truth function arguments were not swapped for the swapped rule! Else it would have been [1.0 0.42] and not [0.9 0.45] again.

patham9 commented 8 years ago

Issue resolved by my commit in Patrick_General_Inference_Tasks. Closed.