opennars / Narjure

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

Missing derivation in NAL2 #30

Closed patham9 closed 8 years ago

patham9 commented 8 years ago

Special theorem-implication rules of NAL2 are not working yet. However since these ones are rarely used and of low practical relevance, this is a low priority issue. After this one is fixed NAL2 will be fully supported:

(generate-conclusions
  (r/rules :belief)
  '{:statement  [--> [ext-set Tweety] [ext-set Birdie]]
    :truth      [0.9 0.9]
    :task-type  :belief
    :occurrence 1000}
  '{:statement  [ext-set Tweety]
    :truth      [1 0.9]
    :task-type  :belief
    :occurrence 1000})

Missing from conclusions:
"<{Birdie} <-> {Tweety}>. %1.0;0.9%"

Responsible rule:
#R[(S --> {P}) S |- (S <-> {P}) :post (:t/identity :d/identity :allow-backward)]
rasom commented 8 years ago

@patham9, this conclusion is reduced to

{:statement [<-> Birdie Tweety],
  :task-type :belief,
  :occurrence 1000,
  :truth [0.9 0.9]}

by normalization rule for similarity which you can find here https://github.com/opennars/opennars2/blob/deriver/src/nal/deriver/normalization.clj#L114

(defn reduce-similarity
  [st]
  (m/match st
    ['<-> ['ext-set s] ['ext-set p]] ['<-> s p]
    ['<-> ['int-set s] ['int-set p]] ['<-> s p]
    :else st))
patham9 commented 8 years ago

fixed