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}
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.)
>>> 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
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.
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?
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
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
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
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"!
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}
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.
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
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.
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
OK, thanks. I submitted an issue. I'll move on to other experiments
which might not come across this issue.