structure transformation in NARS

70 views
Skip to first unread message

Maxim Tarasov

unread,
Apr 2, 2022, 5:30:43 PM4/2/22
to open-nars
First of all, thanks to everyone who has been responding to my questions so far! I am truly grateful to you folks for helping me better understand the theory as I read through the book and attempt to implement it in code. 

My latest stumble comes from structural rules. As I understand it from the book, the basic idea is to take an empirical judgement J1 and combine it with a theorem by treating it as a Narsese judgement J2 with truth value (1,1). The conclusion is derived using strong syllogistic rules. So far so good.

In opennars i see this test case:
```
'Birdie is similar to Tweety
<Birdie <-> Tweety>. %0.90%

'Is Birdie similar to Tweety?
<{Birdie} <-> {Tweety}>? 

''outputMustContain('<{Birdie} <-> {Tweety}>. %0.90;0.73%')
```

So if J1 is <bright <-> smart>. %0.90%
And J2 is S <-> P <=> {S} <-> {P}

What rule is used to derive the conclusion with confidence of 0.73?
The only one I can see as a match is a conditional rule S, S <=> P |- P with analogy truth function but that doesn't seem to align. 

There's probably some other piece of information I'm missing so thanks in advance for your help.

Patrick Hammer

unread,
Apr 7, 2022, 11:24:49 AM4/7/22
to open-nars
Hi Max!

"the basic idea is to take an empirical judgement J1 and combine it with a theorem by treating it as a Narsese judgement J2 with truth value (1,1)"

In OpenNARS the "analytical premise" used for structural rules has truth value (1, reliance), where the default config currently has reliance=0.9 same as default input confidence.
Now as deduction has truth function f_ded((f1,c1), (f2,c2)) = (f1*f2,  f1*f2*c1*c2) and in this case we have f1=0.9 c1=0.9 and analytical premise f2=1.0 c2=0.9
we obtain (f,c) = (0.9*1.0, 0.9*1.0*0.9*0.9) = (0.9, 0.73)

Best regards,
Patrick

Maxim Tarasov

unread,
Apr 7, 2022, 4:32:12 PM4/7/22
to open-nars
Interesting… Thank you, Patrick!

So OpenNARS implementation diverges from the theory described in the book in this case? Is there a reason for restricting the confidence to 0.9? Just curious.

Also, does this mean that deduction rule is used for all structural inference? The rule doesn’t seem to match what I see in the book, with deduction being applicable to inheritance and implication but in this test case we’re dealing with similarity. So is this another design decision where computer implementation deviates from the original theory? Or is it the case that the theory has been revised since the book was published and I’m just operating on old data?

Thank you

Patrick Hammer

unread,
Apr 10, 2022, 3:47:50 PM4/10/22
to open-nars
Hi Max!

I guess Pei omitted discussion about reliance in the 2013 book due to the additional complexity it involves, and since it's usually set to be close to 1.0 anyway.
In the 2009 NAL specification ( https://cis.temple.edu/~pwang/Writing/NAL-Specification.pdf ) this additional paragraph can be found:

The reliance factor is necessary, because many analytical truths are
introduced to define the analytical (literal) meaning of compound terms.
Though these definitions remain true in IL, in NAL the meaning of a com-
pound term also depends on the system’s empirical knowledge about it,
which can be more or less from the related analytical definitions. Con-
sequently, the analytical truths are not absolutely reliable when applied
under AIKR, even though they still contribute to the meaning of the terms
involved.

Maybe Pei has some additional comments about it?

"Also, does this mean that deduction rule is used for all structural inference?:

Analytical premises can be used in any strong inference (inference which is also valid in IL)!

The rule doesn’t seem to match what I see in the book, with deduction being applicable to inheritance and implication but in this test case we’re dealing with similarity."

It's there, page 197 Table B.9, The Equivalence Theorems: <S <-> P> = <{S} <-> {P}>

I hope this helps, and please feel free to ask further questions!

Best regards,
Patrick

Maxim Tarasov

unread,
Apr 10, 2022, 6:50:36 PM4/10/22
to open-nars
Thank you so much for the detailed explanation and for the link! The reliance factor makes sense now. 

But I’m still not clear how deduction rule is chosen for the conclusion. Equivalence theorem you mention matches the analytical truth. So using <S <-> P> <=> <{S} <-> {P}> we get that <Birdie <-> Tweetie> is equivalent to <{Birdie} <-> {Tweetie}>. But how do we know to use deduction rule and not another strong rule to calculate the truth value? 

When I look at deduction I don’t see how it can be a match for one similarity statement <Birdie <-> Tweetie> and an equivalence statement <S <-> P> = <{S} <-> {P}>. Doesn’t deduction operate on inheritance and implication? 

Analogy seems to be a better fit from conditional rules in Table B.2. So given J1: S and J2: S <=> P we derive conclusion P
Here I’m assuming S is <Birdie <-> Tweetie> and P is <{Birdie} <-> {Tweetie}>.

I feel like I’m right on the cusp of understanding so thanks again for your help. It’s been really cool learning about the system so far!

Pei Wang

unread,
Apr 10, 2022, 7:03:41 PM4/10/22
to open-nars
Hi, Max,

I just found that Gmail had put my recent emails from Googlegroups.com in Spam, which is why I missed the previous discussions.

The rule triggered by <Birdie <-> Tweetie> and <S <-> P> <=> <{S} <-> {P}> is not analogy, because the second premise is not an empirical belief stored in memory, but an analytical truth (NAL definition/theorem) embedded in the inference engine. This is how the "single-premise" rules are implemented in NARS.

Regards,

Pei

--
You received this message because you are subscribed to the Google Groups "open-nars" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-nars+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open-nars/3efc7a2f-4bca-4508-b6f6-7ec7d50b6854n%40googlegroups.com.

Maxim Tarasov

unread,
Apr 11, 2022, 4:18:08 PM4/11/22
to open-nars
Thank you, Pei!

I guess the part I’m still having trouble with is this statement in the book “When a definition or theorem in IL (summarized in Tables B.6–B.9) is used as a Narsese judgment J2 with truth value (1,1), it can be used with an empirical judgment J1 to derive a conclusion J by a strong syllogistic rule.

I took that to mean that any strong rule can be used but your response above says that analogy should not be used with analytical truths. And in the NAL-Specification document that Patrick linked the sections about single-premise rules is a bit different from the book.

B.2) Equivalence rules, in Table 11.9, come from theorems of the form “statement1 ≡ statement2”. Each of them can be used in inference as equivalence statement “statement1 ⇔ statement2⟨1, r⟩”.
(B.3) Term reduction rules, in Table 11.10, come from theorems of the form “term1 ↔ term2”. Each of them can be used in inference to reduce term term1 into a simpler term term2, and turns a premise into a conclusion with the same truth-value.
(B.4) Implication rules, in Table 11.11, come from theorems in the form of “statement1 ⊃ statement2”. Each of them can be used in inference as implication statement “statement1 ⇒ statement2⟨1, r⟩”.
(B.5) Inheritance rules, in Table 11.12, come from theorems in the form of “term1 → term2”. Each of them can be used as two implications “(X → term1) ⊃ (X → term2)” and “(term2 → X) ⊃ (term1 → X)”, by the above Implication Rules.


So for B3 I guess it’s pretty straightforward, we get the same truth-values. For B2, B4 do we in essence match our empirical judgement to the left side and simply convert it to the right side using deduction truth function? And I’m not really sure how to interpret B5.

Thank you.


Pei Wang

unread,
Apr 12, 2022, 4:47:55 AM4/12/22
to open-nars
Hi, Max,

Sorry I didn't make it clear. By the "Analogy Rule" we usually mean the rule where both premises are empirical beliefs with confidence < 1. For analytical statements of the form S1 <=> S2, they are actually the B.2 Equivalent Rules in your list, so S1 and S2 can be derived from each other with the same truth-value.  Therefore, "equivalence" is an extreme case of "analogy", just like "identical" is the extreme case of "similarity". In cases where the meaning of the terms cannot be taken literally, S1 <=> S2 will have truth-value (1, r) and the analogy rule is used. Even so, this case is not what we usually call "analogy".

Of course, to use (1, r) for "analytical truths" that are no longer  "analytically true" is an imperfect treatment, and may be refined in the future.

The 2009 NAL Spec is an early draft that eventually evolved into the 2013 NAL book, and some ideas in the former had been changed in the latter for various reasons not documented anywhere. I don't recommend using the Spec unless you are interested in the history of the project.

Regards,

Pei

Maxim Tarasov

unread,
Apr 12, 2022, 9:27:20 PM4/12/22
to open-nars
For analytical statements of the form S1 <=> S2, they are actually the B.2 Equivalent Rules in your list, so S1 and S2 can be derived from each other with the same truth-value. Therefore, "equivalence" is an extreme case of "analogy", just like "identical" is the extreme case of "similarity".
This makes sense. Thank you for the explanation.


In cases where the meaning of the terms cannot be taken literally, S1 <=> S2 will have truth-value (1, r) and the analogy rule is used.
Now this is where I get confused. Patrick above wrote that deduction rule is used to calculate truth value when deriving <{Birdie} <-> {Tweetie}> from <Birdie <-> Tweetie>.

How does deduction come into play?

Patrick Hammer

unread,
Apr 13, 2022, 6:03:56 AM4/13/22
to open-nars
Hi Max!

"In cases where the meaning of the terms cannot be taken literally, S1 <=> S2 will have truth-value (1, r) and the analogy rule is used.
Now this is where I get confused. Patrick above wrote that deduction rule is used to calculate truth value when deriving <{Birdie} <-> {Tweetie}> from <Birdie <-> Tweetie>.

How does deduction come into play?"

Deduction and Analogy are the same in this particular case:
f_ded((f1,c1),(f2,c2)) := (f1*f2, f1*f2*c1*c2)
f_ana((f1,c1),(f2,c2)) := (f1*f2, c1*c2*f2)
and hence, with (f1,c1) := (1,r) we get:
f_ded((1,r),(f2,c2))=(1*f2, 1*f2*r*c2)=(1*f2, r*c2*f2)=f_ana((1,r),(f2,c2))

Best regards,
Patrick

Patrick Hammer

unread,
Apr 13, 2022, 11:33:11 AM4/13/22
to open...@googlegroups.com
Hi Max!

While the previous analysis was right, it also reveals an improvement for the current code:
- to make the analytical premise the second premise in this case, which is equally valid and has the benefit that the result obtained will have higher confidence, as it will not be penalized by the < 1 frequency of the "empirical" statement.
- to use f_ana since in this case f_ded and f_ana result will indeed be different.

Thank you for bringing this up!

Best regards,
Patrick


You received this message because you are subscribed to a topic in the Google Groups "open-nars" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/open-nars/_5Mec6cuSME/unsubscribe.
To unsubscribe from this group and all its topics, send an email to open-nars+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open-nars/1bf62358-7bb3-4ae8-ad72-9f9126f3ada8n%40googlegroups.com.

Maxim Tarasov

unread,
Apr 13, 2022, 11:50:39 AM4/13/22
to open-nars

Thank you again for taking the time to respond! And this is exactly what I thought as I was reading your previous comment just now :) If we use the analytical truth as J1 then we can certainly get the truth value to match that of the test case but if we use it as J2 then we get the value that I kept getting using analogy.

All of the puzzle pieces finally fell into place! :)
Reply all
Reply to author
Forward
0 new messages