Do penguins fly?

17 views
Skip to first unread message

Jeff Thompson

unread,
Sep 12, 2009, 4:07:49 PM9/12/09
to open...@googlegroups.com
Thanks to your bug fixes, Pei, I was able to run some more experiments
like this one:
<{b1} --> canary> .
<{b1} --> fly> .
<{p1} --> penguin> .
<{p1} --> nofly> .
<<#1 --> nofly> ==> (--, <#1 --> fly>)> . %1; 1%
<<#1 --> fly> ==> (--, <#1 --> nofly>)> . %1; 1%
<canary --> fly> ?
<penguin --> fly> ?
<canary --> nofly> ?
<penguin --> nofly> ?

After about 50000 cycles, NARS gives the following answers. (The
derivation trees are included below. I'll commit the derivation display
code this weekend):
<canary --> fly>. %1.0000;0.6183% {54: 1;5;2;6}
<penguin --> nofly>. %1.0000;0.6183% {12: 7;3;8;4}
<canary --> nofly>. %0.3587;0.7164% {49423: 1;7;10;4;5;3;2;8}
<penguin --> fly>. %0.4944;0.7178% {37453: 7;5;4;2;8;1;3;6}

<canary --> fly> is derived as expected. But <canary --> nofly> has a
higher confidence, and if "fly" and "nofly" are being compared, then
<canary --> nofly> is chosen as the better belief, which is not what I
expect. I included the following "definitions" to try to prevent this.
<<#1 --> nofly> ==> (--, <#1 --> fly>)> . %1; 1%
<<#1 --> fly> ==> (--, <#1 --> nofly>)> . %1; 1%

I notice that one of the derivation steps (shown below) infers from
(--,<canary --> nofly>). %1.0000;0.6183%
to
<canary --> nofly>. %0.0000;0.6183%
with the same truth value. Could this be a bug? Should I submit an issue?

I also notice that one of the steps (shown below) infers from
<penguin --> nofly>. %1.0000;0.4475%
to
<penguin --> (&,fly,nofly)>. %1.0000;0.3092%
"penguins fly and don't fly" which is the kind of thing I was trying to
prevent with the "definitions" that fly and nofly are "disjoint". Is
there another way to achieve this?

- Jeff

=========================
<canary --> fly>. %1.0000;0.6183% {54: 1;5;2;6}
<canary --> fly>. %1.0000;0.4475% {10: 5;6}
<{b1} --> fly>. %1.0000;0.9000% {0: 6}
<{b1} --> canary>. %1.0000;0.9000% {0: 5}
<canary --> fly>. %1.0000;0.4475% {53: 1;2}
<{b2} --> fly>. %1.0000;0.9000% {0: 2}
<{b2} --> canary>. %1.0000;0.9000% {0: 1}

<penguin --> nofly>. %1.0000;0.6183% {12: 7;3;8;4}
<penguin --> nofly>. %1.0000;0.4475% {9: 3;4}
<{p2} --> nofly>. %1.0000;0.9000% {0: 4}
<{p2} --> penguin>. %1.0000;0.9000% {0: 3}
<penguin --> nofly>. %1.0000;0.4475% {11: 7;8}
<{p1} --> nofly>. %1.0000;0.9000% {0: 8}
<{p1} --> penguin>. %1.0000;0.9000% {0: 7}

<canary --> nofly>. %0.3587;0.7164% {49423: 1;7;10;4;5;3;2;8}
<canary --> nofly>. %0.0000;0.6183% {448: 1;10;5;2;6}
(--,<canary --> nofly>). %1.0000;0.6183% {448: 1;10;5;2;6}
<<canary --> fly> ==> (--,<canary --> nofly>)>. %1.0000;1.0000%
{0: 10}
<canary --> fly>. %1.0000;0.6183% {54: 1;5;2;6}
<canary --> fly>. %1.0000;0.4475% {10: 5;6}
<{b1} --> fly>. %1.0000;0.9000% {0: 6}
<{b1} --> canary>. %1.0000;0.9000% {0: 5}
<canary --> fly>. %1.0000;0.4475% {53: 1;2}
<{b2} --> fly>. %1.0000;0.9000% {0: 2}
<{b2} --> canary>. %1.0000;0.9000% {0: 1}
<canary --> nofly>. %1.0000;0.4754% {46426: 7;4;3;8}
<(&,{p2},canary) --> nofly>. %1.0000;0.9063% {46426: 7;4;3;8}
<(&,{p2},canary) --> nofly>. %1.0000;0.9000% {0: 4}
<{p2} --> nofly>. %1.0000;0.9000% {0: 4}
<(&,{p2},canary) --> nofly>. %1.0000;0.4027% {46425: 7;3;8}
<(&,{p2},canary) --> (&,canary,penguin)>. %1.0000;0.9000% {0: 3}
<{p2} --> penguin>. %1.0000;0.9000% {0: 3}
<(&,canary,penguin) <-> nofly>. %1.0000;0.4475% {18348: 7;8}
<(&,{p1},canary) --> (&,canary,penguin)>. %1.0000;0.9000% {0: 7}
<{p1} --> penguin>. %1.0000;0.9000% {0: 7}
<(&,{p1},canary) --> nofly>. %1.0000;0.9000% {0: 8}
<{p1} --> nofly>. %1.0000;0.9000% {0: 8}

<penguin --> fly>. %0.4944;0.7178% {37453: 7;5;4;2;8;1;3;6}
<penguin --> fly>. %0.0000;0.5625% {21183: 5;2;1;6}
<(~,{b2},penguin) --> fly>. %1.0000;0.5625% {21183: 5;2;1;6}
<(~,{b2},penguin) --> fly>. %1.0000;0.4737% {0: 2}
<{b2} --> fly>. %1.0000;0.9000% {0: 2}
<(~,{b2},penguin) --> fly>. %1.0000;0.2783% {21182: 5;1;6}
<(~,{b2},penguin) --> (~,canary,penguin)>. %1.0000;0.9000% {0: 1}
<{b2} --> canary>. %1.0000;0.9000% {0: 1}
<(~,canary,penguin) --> fly>. %1.0000;0.3092% {8333: 5;6}
<canary --> fly>. %1.0000;0.4475% {8333: 5;6}
<{b1} --> fly>. %1.0000;0.9000% {0: 6}
<{b1} --> canary>. %1.0000;0.9000% {0: 5}
<penguin --> fly>. %1.0000;0.5570% {36160: 7;4;8;3}
<penguin --> (&,fly,nofly)>. %1.0000;0.5570% {36160: 7;4;8;3}
<penguin --> (&,fly,nofly)>. %1.0000;0.3092% {6852: 4;3}
<penguin --> nofly>. %1.0000;0.4475% {6852: 4;3}
<{p2} --> nofly>. %1.0000;0.9000% {0: 4}
<{p2} --> penguin>. %1.0000;0.9000% {0: 3}
<penguin --> (&,fly,nofly)>. %1.0000;0.4475% {36159: 7;8}
<(&,{p1},fly) --> (&,fly,nofly)>. %1.0000;0.9000% {0: 8}
<{p1} --> nofly>. %1.0000;0.9000% {0: 8}
<(&,{p1},fly) --> penguin>. %1.0000;0.9000% {0: 7}
<{p1} --> penguin>. %1.0000;0.9000% {0: 7}

Jeff Thompson

unread,
Sep 12, 2009, 4:10:57 PM9/12/09
to open...@googlegroups.com
Correction: The input for the experiment is the following (including
{b2} terms, etc.)
<{b1} --> canary> .
<{b1} --> fly> .
<{b2} --> canary> .
<{b2} --> fly> .
<{p1} --> penguin> .
<{p1} --> nofly> .
<{p2} --> penguin> .
<{p2} --> nofly> .
<<#1 --> nofly> ==> (--, <#1 --> fly>)> . %1; 1%
<<#1 --> fly> ==> (--, <#1 --> nofly>)> . %1; 1%
<canary --> fly> ?
<penguin --> fly> ?
<canary --> nofly> ?
<penguin --> nofly> ?

Pei Wang

unread,
Sep 12, 2009, 7:46:06 PM9/12/09
to open...@googlegroups.com
Jeff,

Before I think about the issue you addressed, let me point out what I
noticed in the first look: it is not allowed to have 1 as the
confidence of a belief (that value can only appear in the
meta-language as a limit). A violation of that may cause serious
problem in the system.

I'm going to change the code, so that confidence 1 will be
automatically changed into 0.9999 at input. You may want to try your
example in the updated code, to see if there is any difference.

Pei

Pei Wang

unread,
Sep 12, 2009, 8:25:11 PM9/12/09
to open...@googlegroups.com
Change committed.

More explanation: a belief with confidence 1.0 cannot be revised, and
several truth-value functions contain division by 1-c, which is 0 when
c == 1.

Conceptually, NAL theorems are treated as with truth-value %1;1%, but
none of them shows up as (object-level) beliefs. Instead, they appear
implicitly in the inference rules, especially the StructuralRules. All
"definitions" in the object level, like "No-fly means cannot fly" are
all revisable in principle, so shouldn't have confidence 1.

Pei

Pei Wang

unread,
Sep 12, 2009, 10:49:25 PM9/12/09
to open...@googlegroups.com
On Sat, Sep 12, 2009 at 4:07 PM, Jeff Thompson <jef...@gmail.com> wrote:
>
> Thanks to your bug fixes, Pei,

Thanks for the testing --- previously I rarely run examples with more
than 1000 cycles, since I thought the system is not ready for that and
the result will be too complicated to analyze at the current stage,
but you show me otherwise.

> I was able to run some more experiments
> like this one:
> <{b1} --> canary> .
> <{b1} --> fly> .
> <{p1} --> penguin> .
> <{p1} --> nofly> .
> <<#1 --> nofly> ==> (--, <#1 --> fly>)> . %1; 1%
> <<#1 --> fly> ==> (--, <#1 --> nofly>)> . %1; 1%
> <canary --> fly> ?
> <penguin --> fly> ?
> <canary --> nofly> ?
> <penguin --> nofly> ?
>
> After about 50000 cycles, NARS gives the following answers. (The
> derivation trees are included below. I'll commit the derivation display
> code this weekend):
> <canary --> fly>. %1.0000;0.6183% {54: 1;5;2;6}
> <penguin --> nofly>. %1.0000;0.6183% {12: 7;3;8;4}
> <canary --> nofly>. %0.3587;0.7164% {49423: 1;7;10;4;5;3;2;8}
> <penguin --> fly>. %0.4944;0.7178% {37453: 7;5;4;2;8;1;3;6}

The numbers I got, on the changed code with your corrected example,
are different. I wonder if it has something to do with c=1. Please let
me know if you can still get the problem.

> <canary --> fly> is derived as expected.  But <canary --> nofly> has a
> higher confidence, and if "fly" and "nofly" are being compared, then
> <canary --> nofly> is chosen as the better belief, which is not what I
> expect.  I included the following "definitions" to try to prevent this.
> <<#1 --> nofly> ==> (--, <#1 --> fly>)> . %1; 1%
> <<#1 --> fly> ==> (--, <#1 --> nofly>)> . %1; 1%

Not sure about this one, but negation-related inference still has some
issues in it. For example, the system should be able to automatically
introduce the negation operator for beliefs with low frequency.

> I notice that one of the derivation steps (shown below) infers from
> (--,<canary --> nofly>). %1.0000;0.6183%
> to
> <canary --> nofly>. %0.0000;0.6183%
> with the same truth value.  Could this be a bug?  Should I submit an issue?

This directly comes from the definition of "negation" in NAL --- see
Section 7.3 of the Spec.

> I also notice that one of the steps (shown below) infers from
> <penguin --> nofly>. %1.0000;0.4475%
> to
> <penguin --> (&,fly,nofly)>. %1.0000;0.3092%
> "penguins fly and don't fly" which is the kind of thing I was trying to
> prevent with the "definitions" that fly and nofly are "disjoint".  Is
> there another way to achieve this?

The current composition rule derived S --> (P1 & P2) from S --> P1 and
S --> P2, under the assumption that the two premises are independent
of each other. Your example is clearly a situation where the
assumption is not true. My previous idea is that when the two are not
independent, they will have overlapping evidence, so the undesired
results won't be derived. It may be not enough.

If the problem still exist in the new code, please create an issue.

Pei

Jeff Thompson

unread,
Sep 13, 2009, 5:32:55 AM9/13/09
to open...@googlegroups.com
Pei Wang wrote:
>> I notice that one of the derivation steps (shown below) infers from
>> (--,<canary --> nofly>). %1.0000;0.6183%
>> to
>> <canary --> nofly>. %0.0000;0.6183%
>> with the same truth value. Could this be a bug? Should I submit an issue?
>>
>
> This directly comes from the definition of "negation" in NAL --- see
> Section 7.3 of the Spec.
>

Sorry about this one. When I first looked at it, I didn't notice that
the frequency changed from 1 to 0.

>> I also notice that one of the steps (shown below) infers from
>> <penguin --> nofly>. %1.0000;0.4475%
>> to
>> <penguin --> (&,fly,nofly)>. %1.0000;0.3092%
>> "penguins fly and don't fly" which is the kind of thing I was trying to
>> prevent with the "definitions" that fly and nofly are "disjoint". Is
>> there another way to achieve this?
>>
>
> The current composition rule derived S --> (P1 & P2) from S --> P1 and
> S --> P2, under the assumption that the two premises are independent
> of each other. Your example is clearly a situation where the
> assumption is not true. My previous idea is that when the two are not
> independent, they will have overlapping evidence, so the undesired
> results won't be derived. It may be not enough.
>
> If the problem still exist in the new code, please create an issue.
>

The problem above is not in the new code. But the following is
similar. With the following input:


<{b2} --> canary> .
<{b2} --> fly> .

<{p2} --> penguin> .
<{p2} --> nofly> .

<{b1} --> canary> .
<{b1} --> fly> .
<{p1} --> penguin> .
<{p1} --> nofly> .

<<#1 --> nofly> ==> (--, <#1 --> fly>)> . %1; .9999%
<<#1 --> fly> ==> (--, <#1 --> nofly>)> . %1; .9999%


<canary --> fly> ?
<penguin --> fly> ?
<canary --> nofly> ?
<penguin --> nofly> ?

<(&,{p1},fly) --> (&,fly,nofly)> ?

NARS derives from
<{p1} --> nofly>. %1.0000;0.9039% {69: 3;8;7;4}
to
<(&,{p1},fly) --> (&,fly,nofly)>. %1.0000;0.9039% {69: 3;8;7;4}


Is that correct? (This may be the same as issue 14 that I just opened.)


Pei Wang

unread,
Sep 13, 2009, 11:21:26 AM9/13/09
to open...@googlegroups.com
On Sun, Sep 13, 2009 at 5:32 AM, Jeff Thompson <jef...@gmail.com> wrote:

>>> I also notice that one of the steps (shown below) infers from
>>> <penguin --> nofly>. %1.0000;0.4475%
>>> to
>>> <penguin --> (&,fly,nofly)>. %1.0000;0.3092%
>>> "penguins fly and don't fly" which is the kind of thing I was trying to
>>> prevent with the "definitions" that fly and nofly are "disjoint".  Is
>>> there another way to achieve this?
>>>
>>
>> The current composition rule derived S --> (P1 & P2) from S --> P1 and
>> S --> P2, under the assumption that the two premises are independent
>> of each other. Your example is clearly a situation where the
>> assumption is not true. My previous idea is that when the two are not
>> independent, they will have overlapping evidence, so the undesired
>> results won't be derived. It may be not enough.

One possible solution is to add a "discount factor" d into the
confidence of the conclusion, so that if P1 and P2 are strongly
correlated, either positively or negatively, the conclusion will have
very low confidence. The correlation can be estimated from the
truth-value of P1 <-> P2.

I have add it into me conceptual issue list, and will think more about
it. Since it is not an implementation issue, no action needs to be
taken in open-nars for now.

The problem won't be too big, because concepts like (fly & nofly)
won't be useful for the system, so cannot get high priority --- it is
another issue handled by the control mechanism, which I guess you
don't like. ;-)

> NARS derives from
> <{p1} --> nofly>. %1.0000;0.9039% {69: 3;8;7;4}
> to
> <(&,{p1},fly) --> (&,fly,nofly)>. %1.0000;0.9039% {69: 3;8;7;4}
>
> Is that correct? (This may be the same as issue 14 that I just opened.)

It is derived from Theorem 24 (page 28 of the Spec), and should be fine.

Pei

Jeff Thompson

unread,
Sep 13, 2009, 1:52:17 PM9/13/09
to open...@googlegroups.com
Pei Wang wrote:
>> NARS derives from
>> <{p1} --> nofly>. %1.0000;0.9039% {69: 3;8;7;4}
>> to
>> <(&,{p1},fly) --> (&,fly,nofly)>. %1.0000;0.9039% {69: 3;8;7;4}
>>
>> Is that correct? (This may be the same as issue 14 that I just opened.)
>>
>
> It is derived from Theorem 24 (page 28 of the Spec), and should be fine.
>

Then I'm a little confused. (By the way, Theorem 24 lists two
implications, then repeats them.)
Definition 32 says "for all x ((x -> (T1 & T2)) === ((x -> T1) and (x ->
T2)))". And Therem 18 says "(T1 & T2)I = (T1)I
union (T2)I". Doesn't this mean that Definition 32 has the corollary:
for all x (((T1 & T2) -> x) === ((T1 -> x) or (T2 -> x)))

In other words, <x -> (&, T1, T2)> means "x is T1 and T2", but <(&, T1,
T2) -> x> means "T1 is x or T2 is x". This follows from "extensional
intersection corresponds to intensional union". Is that right? This
means that Theorem 24
S --> P implies (&, S, M) --> (&, P, M)
does not mean "S is P implies that something that is S and M is P and M"
(which sounds right) but rather "S is P implies that something that is S
or M is P and M" which doesn't seem to follow.


Jeff Thompson

unread,
Sep 13, 2009, 2:14:07 PM9/13/09
to open...@googlegroups.com

In other words, if <x --> (&, P, M)> means "x is P and x is M", then
what does <(&, S, M) --> x> mean? And then what does <(&, S, M) --> (&,
P, M)> mean?

Pei Wang

unread,
Sep 13, 2009, 2:21:41 PM9/13/09
to open...@googlegroups.com
On Sun, Sep 13, 2009 at 1:52 PM, Jeff Thompson <jef...@gmail.com> wrote:
>
> Pei Wang wrote:
>>> NARS derives from
>>> <{p1} --> nofly>. %1.0000;0.9039% {69: 3;8;7;4}
>>> to
>>> <(&,{p1},fly) --> (&,fly,nofly)>. %1.0000;0.9039% {69: 3;8;7;4}
>>>
>>> Is that correct? (This may be the same as issue 14 that I just opened.)
>>>
>>
>> It is derived from Theorem 24 (page 28 of the Spec), and should be fine.
>>
>
> Then I'm a little confused.  (By the way, Theorem 24 lists two
> implications, then repeats them.)

Sorry for the typo: the last two should be about similarity
statements. I just updated
http://www.cis.temple.edu/~pwang/Writing/NAL-Specification.pdf

> Definition 32 says "for all x ((x -> (T1 & T2)) === ((x -> T1) and (x ->
> T2)))". And Therem 18 says "(T1 & T2)I = (T1)I
> union (T2)I". Doesn't this mean that Definition 32 has the corollary:
> for all x (((T1 & T2) -> x) === ((T1 -> x) or (T2 -> x)))

Yes. That is implied by Theorem 18, the intensional part.

> In other words, <x -> (&, T1, T2)> means "x is T1 and T2", but <(&, T1,
> T2) -> x> means "T1 is x or T2 is x".  This follows from "extensional
> intersection corresponds to intensional union". Is that right?

Correct.

> This means that Theorem 24
> S --> P implies (&, S, M) --> (&, P, M)
> does not mean "S is P implies that something that is S and M is P and M"
> (which sounds right) but rather "S is P implies that something that is S
> or M is P and M" which doesn't seem to follow.

It is still the former --- this sentence is about the extensions of
both compounds.

Pei

Pei Wang

unread,
Sep 13, 2009, 2:31:25 PM9/13/09
to open...@googlegroups.com
On Sun, Sep 13, 2009 at 2:14 PM, Jeff Thompson <jef...@gmail.com> wrote:
>
> In other words, if <x --> (&, P, M)> means "x is P and x is M", then
> what does <(&, S, M) --> x> mean?

It means "Whatever is both S and M is also x", but it also means "S
is x or M is x", in your format.

> And then what does <(&, S, M) --> (&, P, M)> mean?

Extensionally, it means "Whatever is both S and M is also both P and
M", and intensionally, "A property of P or M is also a property of S
or M".

It is important to understand that almost every statement in NAL has
an "extensional reading" and an "intensional reading", which may sound
different, but are equivalent to each other.

Pei

Jeff Thompson

unread,
Sep 13, 2009, 3:56:09 PM9/13/09
to open-nars
On Sep 13, 8:21 am, Pei Wang <NARS.W...@gmail.com> wrote:
> On Sun, Sep 13, 2009 at 5:32 AM, Jeff Thompson <jef...@gmail.com> wrote:
> >>> I also notice that one of the steps (shown below) infers from
> >>> <penguin --> nofly>. %1.0000;0.4475%
> >>> to
> >>> <penguin --> (&,fly,nofly)>. %1.0000;0.3092%
> >>> "penguins fly and don't fly" which is the kind of thing I was trying to
> >>> prevent with the "definitions" that fly and nofly are "disjoint".  Is
> >>> there another way to achieve this?

> One possible solution is to add a "discount factor" d into the
> confidence of the conclusion, so that if P1 and P2 are strongly
> correlated, either positively or negatively, the conclusion will have
> very low confidence. The correlation can be estimated from the
> truth-value of P1 <-> P2.
>
> I have add it into me conceptual issue list, and will think more about
> it. Since it is not an implementation issue, no action needs to be
> taken in open-nars for now.
>
> The problem won't be too big, because concepts like (fly & nofly)
> won't be useful for the system, so cannot get high priority --- it is
> another issue handled by the control mechanism, which I guess you
> don't like. ;-)

I will like it if the inference control algorithms are formalized so
that they can be understood by humans - and by NARS itself.
Otherwise, I worry that NARS will be another evolved and not
understood system, as tricks are thrown in to the control mechanism
prevent results that the formal theory implies, but are viewed as "not
fit" and so filtered out in an ad-hoc way. That's what nature did for
the human brain, and it works, but we don't understand it. This is
what the neural-network people are doing, and they may achieve some
results, but there is no theory or understanding behind it.

Pei Wang

unread,
Sep 13, 2009, 4:07:15 PM9/13/09
to open...@googlegroups.com
On Sun, Sep 13, 2009 at 3:56 PM, Jeff Thompson <jef...@gmail.com> wrote:
>
> I will like it if the inference control algorithms are formalized so
> that they can be understood by humans - and by NARS itself.
> Otherwise, I worry that NARS will be another evolved and not
> understood system, as tricks are thrown in to the control mechanism
> prevent results that the formal theory implies, but are viewed as "not
> fit" and so filtered out in an ad-hoc way.  That's what nature did for
> the human brain, and it works, but we don't understand it.  This is
> what the neural-network people are doing, and they may achieve some
> results, but there is no theory or understanding behind it.

Agree. That is why I usually don't leave issues to magical forces like
"emergence".

As to what extent the control part can be theorized at the end, I
don't really know --- I'm doing my best and see how far it goes. What
I do know is that I won't introduce unrealistic assumptions to make
the conclusions pretty (for example, AIXI).

Pei

Jeff Thompson

unread,
Sep 13, 2009, 4:18:50 PM9/13/09
to open...@googlegroups.com
Pei Wang wrote:
> On Sun, Sep 13, 2009 at 3:56 PM, Jeff Thompson <jef...@gmail.com> wrote:
>
>> I will like it if the inference control algorithms are formalized so
>> that they can be understood by humans - and by NARS itself.
>> Otherwise, I worry that NARS will be another evolved and not
>> understood system, as tricks are thrown in to the control mechanism
>> prevent results that the formal theory implies, but are viewed as "not
>> fit" and so filtered out in an ad-hoc way. That's what nature did for
>> the human brain, and it works, but we don't understand it. This is
>> what the neural-network people are doing, and they may achieve some
>> results, but there is no theory or understanding behind it.
>>
>
> Agree. That is why I usually don't leave issues to magical forces like
> "emergence".
>

Thanks. Glad to hear it.

> As to what extent the control part can be theorized at the end, I
> don't really know --- I'm doing my best and see how far it goes. What
> I do know is that I won't introduce unrealistic assumptions to make
> the conclusions pretty (for example, AIXI).

I see what you mean. Right in the definition of AIXI, it says "Assume
the availability of unlimited computational resources"!


Jeff Thompson

unread,
Sep 15, 2009, 1:27:19 AM9/15/09
to open...@googlegroups.com
Continuing with these experiments, after the recent bug fixes, I run the
following input (and where Parameters.MAXMUM_STAMP_LENGTH = 16 and
Parameters.MAXMUM_BELIEF_LENGTH = 8):
<{c1} --> canary> .
<{c1} --> fly> .
<{c2} --> canary> .
<{c2} --> fly> .

<{p1} --> penguin> .
<{p1} --> nofly> .
<{p2} --> penguin> .
<{p2} --> nofly> .
<<#1 --> nofly> ==> (--, <#1 --> fly>)> . %1; .9999%
<<#1 --> fly> ==> (--, <#1 --> nofly>)> . %1; .9999%
<<#1 --> nofly> ==> <#1 --> fly>> . %0; .9999%
<<#1 --> fly> ==> <#1 --> nofly>> . %0; .9999%
<canary --> fly> ?
<penguin --> nofly> ?
<canary --> nofly> ?
<penguin --> fly> ?

After many cycles, NARS gives the following best answers:


<canary --> fly>. %1.0000;0.6183%

<penguin --> nofly>. %1.0000;0.6183%
<canary --> nofly>. %0.0000;0.7570%
<penguin --> fly>. %0.4371;0.7420%

(The lengthy derivations for the last two are included below.)
I'm happy, of course, except that <penguin --> fly> has a higher
confidence than <penguin --> nofly>. However, <canary --> nofly> has an
even higher confidence than <penguin --> nofly>, and since the
statements about penguins and canaries are symmetric, it seems that NARS
might eventually derive the result I want:
<penguin --> fly>. %0.0000;0.7570%

Maybe this is a case where I would agree that tuning the inference
control can come to the rescue! :-) It makes me want to "nudge" NARS to
get it to consider the same higher-confidence premises for <penguin -->
fly> %0% that it considered for <canary --> nofly> %0%. Perhaps
eventually it will, but I ran for a while and it seems stuck. Maybe the
task/term/belief link buffers are not turning over?

Also, in the above input I included the following sentences to try to
say that fly and nofly are "defined" to be "disjoint". Do you think
this is a good approach, or is this not how NAL is meant to be used?
Would you include others?


<<#1 --> nofly> ==> (--, <#1 --> fly>)> . %1; .9999%
<<#1 --> fly> ==> (--, <#1 --> nofly>)> . %1; .9999%

<<#1 --> nofly> ==> <#1 --> fly>> . %0; .9999%
<<#1 --> fly> ==> <#1 --> nofly>> . %0; .9999%

- Jeff
=========================
<canary --> nofly>. %0.0000;0.7570% {50415: 10;6;1;5;8;2}
<canary --> nofly>. %0.0000;0.7289% {43096: 10;1;8;2}
<(~,{p2},canary) --> nofly>. %1.0000;0.7289% {43096: 10;1;8;2}
<(~,{p2},canary) --> (~,{p2},{c1})>. %1.0000;0.9000% {0: 1}
<{c1} --> canary>. %1.0000;0.9000% {0: 1}
<(~,{p2},{c1}) --> nofly>. %1.0000;0.8099% {993: 10;8;2}
<{p2} --> nofly>. %1.0000;0.9000% {0: 8}
<{c1} --> nofly>. %0.0000;0.8999% {126: 10;2}
(--,<{c1} --> nofly>). %1.0000;0.8999% {126: 10;2}
<<{c1} --> fly> ==> (--,<{c1} --> nofly>)>. %1.0000;0.9999%
{0: 10}
<{c1} --> fly>. %1.0000;0.9000% {0: 2}
<canary --> nofly>. %0.0000;0.2989% {35638: 6;5}
<(~,penguin,canary) --> nofly>. %1.0000;0.2989% {35638: 6;5}
<(~,{p1},canary) --> nofly>. %1.0000;0.4737% {0: 6}
<{p1} --> nofly>. %1.0000;0.9000% {0: 6}
<(~,{p1},canary) --> (~,penguin,canary)>. %1.0000;0.9000% {0: 5}
<{p1} --> penguin>. %1.0000;0.9000% {0: 5}

<penguin --> fly>. %0.4371;0.7420% {18795: 7;2;9;4;5;1;8;3;6}
<penguin --> fly>. %0.0000;0.6182% {2026: 7;9;5;8;6}
(--,<penguin --> fly>). %1.0000;0.6182% {2026: 7;9;5;8;6}
<<penguin --> nofly> ==> (--,<penguin --> fly>)>. %1.0000;0.9999%
{0: 9}
<penguin --> nofly>. %1.0000;0.6183% {10: 7;5;8;6}
<penguin --> nofly>. %1.0000;0.4475% {8: 5;6}
<{p1} --> nofly>. %1.0000;0.9000% {0: 6}
<{p1} --> penguin>. %1.0000;0.9000% {0: 5}
<penguin --> nofly>. %1.0000;0.4475% {9: 7;8}
<{p2} --> nofly>. %1.0000;0.9000% {0: 8}
<{p2} --> penguin>. %1.0000;0.9000% {0: 7}
<penguin --> fly>. %1.0000;0.5570% {17851: 2;4;1;3}
<(|,canary,penguin) --> fly>. %1.0000;0.5570% {17851: 2;4;1;3}
<(|,canary,penguin) --> fly>. %1.0000;0.3092% {9351: 4;3}
<canary --> fly>. %1.0000;0.4475% {9351: 4;3}
<(&,{c2},nofly) --> fly>. %1.0000;0.9000% {0: 4}
<{c2} --> fly>. %1.0000;0.9000% {0: 4}
<(&,{c2},nofly) --> canary>. %1.0000;0.9000% {0: 3}
<{c2} --> canary>. %1.0000;0.9000% {0: 3}
<(|,canary,penguin) --> fly>. %1.0000;0.4475% {17850: 2;1}
<{c1} --> fly>. %1.0000;0.9000% {0: 2}
<{c1} --> (|,canary,penguin)>. %1.0000;0.9000% {0: 1}
<{c1} --> canary>. %1.0000;0.9000% {0: 1}


Pei Wang

unread,
Sep 18, 2009, 9:36:25 PM9/18/09
to open...@googlegroups.com
Jeff,

I just added two new functions, which seem to be able to handle your
examples, as well as some related cases:

r111: to directly derive "(--, a). $1.00;0.90$" from "a. $0.00;0.90$"

r112: to multiple a "discount factor" to the confidence of
compositional conclusions like "<a --> (&, b, c)>." according to the
truth-value of <b <-> c> --- if the truth-value is close to
$1.00;0.99% or $0.00;0.99%, the confidence will be very low.

Both functions belong to the things that I thought can be covered by
existing mechanisms, so don't need to be directly coded, though now I
want to give them a try. The first one produces many repeated
conclusion, which is annoying. The second uses an estimation, and its
effect needs to be decided by further testings.

Pei

Jeff Thompson

unread,
Sep 19, 2009, 1:44:55 PM9/19/09
to open...@googlegroups.com
Pei Wang wrote:
> r112: to multiple a "discount factor" to the confidence of
> compositional conclusions like "<a --> (&, b, c)>." according to the
> truth-value of <b <-> c> --- if the truth-value is close to
> $1.00;0.99% or $0.00;0.99%, the confidence will be very low.
>

Thanks very much for quickly fixing the variable binding issue. (I was
worried about that one.) I tried my same example again and part of the
derivation is:
<(&,canary,penguin) --> fly>. %1.0000;0.4475% {41923: 2;1}
<(&,{c1},penguin) --> fly>. %1.0000;0.9000% {30588: 2}


<{c1} --> fly>. %1.0000;0.9000% {0: 2}

<(&,{c1},penguin) --> (&,canary,penguin)>. %1.0000;0.9000%
{6323: 1}


<{c1} --> canary>. %1.0000;0.9000% {0: 1}

It seems that many steps such as inferring from from
<{c1} --> canary>. %1.0000;0.9000% to <(&,{c1},penguin) -->
(&,canary,penguin)>. %1.0000;0.9000%
with the same confidence should be discounted by your new formula. In
this case, StructuralRules.structuralCompose1 does
structuralStatement(subj, compound,
TruthFunctions.implied(truth));
which calls TruthFunctions.implied which doesn't use the discount.

Pei Wang

unread,
Sep 19, 2009, 2:49:42 PM9/19/09
to open...@googlegroups.com
On Sat, Sep 19, 2009 at 1:44 PM, Jeff Thompson <jef...@gmail.com> wrote:
>
> Pei Wang wrote:
>> r112: to multiple a "discount factor" to the confidence of
>> compositional conclusions like "<a --> (&, b, c)>." according to the
>> truth-value of <b <-> c> --- if the truth-value is close to
>> $1.00;0.99% or $0.00;0.99%, the confidence will be very low.
>>
>
> Thanks very much for quickly fixing the variable binding issue. (I was
> worried about that one.)  I tried my same example again and part of the
> derivation is:
>      <(&,canary,penguin) --> fly>. %1.0000;0.4475% {41923: 2;1}
>        <(&,{c1},penguin) --> fly>. %1.0000;0.9000% {30588: 2}
>          <{c1} --> fly>. %1.0000;0.9000% {0: 2}
>        <(&,{c1},penguin) --> (&,canary,penguin)>. %1.0000;0.9000%
> {6323: 1}
>          <{c1} --> canary>. %1.0000;0.9000% {0: 1}
>
> It seems that many steps such as inferring from from
> <{c1} --> canary>. %1.0000;0.9000% to <(&,{c1},penguin) -->
> (&,canary,penguin)>. %1.0000;0.9000%
> with the same confidence should be discounted by your new formula. In
> this case, StructuralRules.structuralCompose1 does
>                structuralStatement(subj, compound,
> TruthFunctions.implied(truth));
> which calls TruthFunctions.implied which doesn't use the discount.

Thanks!

Just added it to structuralCompose2, which is the rule responsible for
the above example. Rule structuralCompose1 doesn't compose new
compound, so it won't need this discount.

Pei

Jeff Thompson

unread,
Sep 19, 2009, 4:20:36 PM9/19/09
to open...@googlegroups.com
You're welcome. Thank you. These fixes are helping maintain the
"primary" derivations of <canary --> fly>. %1.0000;0.6183% and <penguin
--> nofly>. %1.0000;0.6183%. (Before, these would drift away from
frequency of 1.)

I'm still seeing derivations like the following which infer from <{p2}
--> penguin> and <{p2} --> nofly> to <canary --> nofly>. It does this by
introducing "canary" into <{p2} --> (|,canary,penguin)> "for free" with
the same truth value. Should this be discounted also, since canary and
penguin don't correlate well?

<canary --> nofly>. %1.0000;0.4475% {128125: 8;7}
<(|,canary,penguin) --> nofly>. %1.0000;0.4475% {82778: 8;7}
<{p2} --> nofly>. %1.0000;0.9000% {0: 8}
<{p2} --> (|,canary,penguin)>. %1.0000;0.9000% {2870: 7}
<{p2} --> penguin>. %1.0000;0.9000% {0: 7}


Pei Wang

unread,
Sep 19, 2009, 6:16:50 PM9/19/09
to open...@googlegroups.com

My current plan is to apply the discount factor whenever a compound is
formed, but not when it is used (which may be too much). The rule in
structuralCompose1 is the latter case --- the conclusion <{p2} -->
(|,canary,penguin)> is derived from <{p2} --> penguin> plus the
information that "penguin is a component of an existing compound
(|,canary,penguin)" (which doesn't show up in the derivation tree).
When (|,canary,penguin) was formed earlier, the discount factor should
have been applied, which influence the priority of the concept, so if
the correlation is high, the concept won't be often used.

Compare the above case with structuralCompose2, which derives
<(|,canary,{p2}) --> (|,canary,penguin)> from <{p2} --> penguin> plus
the information that "penguin is a component of an existing compound
(|,canary,penguin)". In this case, the discount is based on the newly
formed (|,canary,{p2}), not the existing (|,canary,penguin).

I hope this will be enough. If in the future it turns out to be better
to apply the discount whenever the compound appear in conclusion, then
it can be added.

Pei

Jeff Thompson

unread,
Sep 20, 2009, 1:35:17 PM9/20/09
to open...@googlegroups.com
Pei Wang wrote:
> On Sat, Sep 19, 2009 at 4:20 PM, Jeff Thompson <jef...@gmail.com> wrote:
>
>> I'm still seeing derivations like the following which infer from <{p2}
>> --> penguin> and <{p2} --> nofly> to <canary --> nofly>. It does this by
>> introducing "canary" into <{p2} --> (|,canary,penguin)> "for free" with
>> the same truth value. Should this be discounted also, since canary and
>> penguin don't correlate well?
>>
>> <canary --> nofly>. %1.0000;0.4475% {128125: 8;7}
>> <(|,canary,penguin) --> nofly>. %1.0000;0.4475% {82778: 8;7}
>> <{p2} --> nofly>. %1.0000;0.9000% {0: 8}
>> <{p2} --> (|,canary,penguin)>. %1.0000;0.9000% {2870: 7}
>> <{p2} --> penguin>. %1.0000;0.9000% {0: 7}
>>
>
> My current plan is to apply the discount factor whenever a compound is
> formed, but not when it is used (which may be too much). The rule in
> structuralCompose1 is the latter case --- the conclusion <{p2} -->
> (|,canary,penguin)> is derived from <{p2} --> penguin> plus the
> information that "penguin is a component of an existing compound
> (|,canary,penguin)" (which doesn't show up in the derivation tree).
> When (|,canary,penguin) was formed earlier, the discount factor should
> have been applied, which influence the priority of the concept, so if
> the correlation is high, the concept won't be often used.
>
I still don't understand where the discount, if any, is used. NARS does
induction between <{p2} --> (|,canary,penguin)> and <{p2} --> nofly> to
get <(|,canary,penguin) --> nofly>, using the usual truth value for
induction with no discount. Then it "removes" penguin to get <canary -->
nofly> with the same truth value, no discount.

In this way, NARS starts with a high confidence statement like
<{p2} --> nofly> %1.0000;0.9000%,
introduces an unrelated term like 'canary', and concludes


<canary --> nofly>. %1.0000;0.4475%

when the only connection between 'canary' and 'nofly' is from <canary
--> fly> and the "definition" where I'm trying to say that "fly" and
"nofly" are not connected. The problem is that NARS then does a similar
derivation starting from different evidence to also conclude <canary -->
nofly>, then does revision to combine them. In this way, NARS can
convince itself with high confidence of just about anything. That can't
be right.

Pei Wang

unread,
Sep 20, 2009, 4:49:35 PM9/20/09
to open...@googlegroups.com

No, the above issue cannot be solved by the discount, as you see.

What the discount does is to reduced the chance for terms like (&,
fly, nofly) to be created, which is a different issue.

Here the problem is to restrict the usage of the "definitional
beliefs" (theorems). For example, <(&, a, b) --> a> and <(&, a, b) -->
b> are true by definition for arbitrary a and b, but if they are
represented as ordinary beliefs with truth-value %1;1%, then by
comparison they derives <a <-> b> %1;0.5%, which cannot be valid.
therefore, since theorems have no "empirical grounding" (as shown in
Stamp), they cannot be used together in non-deductive inference. On
the other hand, binary deduction is still valid, for example, <(&, a,
b) --> a> and <a --> (|, a, b)> implies <(&, a, b) --> (|, a, b)>,
which is perfectly fine.

There are all kinds of situations in between. What you found is a case
that didn't occur to me before. Of course the conclusion should be
blocked, but it needs to be done carefully to avoid excluding valid
inference. I need to think more about it. You can create an issue,
though it is not a problem in implementation, and I already have it in
my conceptual issue list (like the issues in footnote of NAL Spec).

Pei

Jeff Thompson

unread,
Sep 20, 2009, 6:26:39 PM9/20/09
to open...@googlegroups.com

OK, thanks. I submitted an issue. I'll move on to other experiments
which might not come across this issue.

Reply all
Reply to author
Forward
0 new messages