Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAL3 Truth Function Inconsistent with Docs #62

Open
automenta opened this issue Aug 1, 2016 · 8 comments
Open

NAL3 Truth Function Inconsistent with Docs #62

automenta opened this issue Aug 1, 2016 · 8 comments
Milestone

Comments

@automenta
Copy link

https://github.com/opennars/opennars2/blob/2.0.0_postdev1/src/nal/deriver/truth.clj#L101

(t-and c1 c2)

https://github.com/opennars/opennars2/blob/2.0.0_postdev1/docs/NAL-spec/NAL-3.tex#L206

c &=& or(and(not(f_1), c_1), and(not(f_2), c_2)) + and(f_1, c_1, f_2, c_2)

the preceding paragraph in the NAL spec explains:

When T 1 and T 2 are either highly
similar or opposite to each other, the compound terms produced by these
rules may not have much practical value. However, even when it happens,
it is an issue to be handled by inference control, not by logic.
In the confidence functions, each case for the conclusion to reach its
maximum is separately considered. The plus operator is used in place of an
or operator, because the two cases involved are mutually exclusive, rather
than independent of each other.

i had suspected a symmetric form of this function was missing for negated cases of certain truth functions. not only is the code missing the negated case, inconsistent for the positive case, but i see a possible mistake written for the unimplemented negated case. taking the intersection case as an example

c = or(and(not(f 1 ), c 1 ), and(not(f 2 ), c 2 )) + and(f 1 , c 1 , f 2 , c 2 )

the first component of this formula alone can produce confidence values higher than its conf inputs (ex: two 90% conf inputs producing a 98% conf output in one test case). no other truth functions compute a confidence combining freq and conf in an or( ) in this way.

my guess is that that '+' actually means max as the explanation seems to suggest, and that one of these variations will produce more reasonable confidence values for the various positive and negative combinations.

max(and(f1, f2, c1, c2), and( 1-f1, c1, 1-f2, c2 ))
max(and(f1, f2, c1, c2), and( or(1-f1, 1-f2), c1, c2 ))

otherwise please clarify the documentation and/or why the code seems inconsistent for these functions (including opennars 1.x)

@automenta
Copy link
Author

max(and(f1, f2, c1, c2), and( and(1-f1, 1-f2), c1, c2 ))

@automenta
Copy link
Author

or maybe the c = and(c1,c2) is best but to handle the negation x negation case the frequency needs to involve max:
intersection: Math.max(and(f1, f2), and(1-f1, 1-f2))
union: Math.max(or(f1, f2), or(1-f1, 1-f2))

@automenta
Copy link
Author

err
intersection: Math.max(and(f1, f2), 1-and(1-f1, 1-f2))
union: Math.max(or(f1, f2), 1-or(1-f1, 1-f2))
etc

@automenta
Copy link
Author

n/m that doesnt make sense either

@pei2nars
Copy link
Collaborator

pei2nars commented Aug 1, 2016

The NAL spec function is a previous version that tried to handle all the
cases together. The function in the new version in the NAL book (which is
the current code) separate the two-premise case from the one-premise cases,
and is conceptually simpler and practically equivalent -- when all the
rules are used, the choice rule will prefer the more confident conclusion,
so no additional max operator is needed.

On Mon, Aug 1, 2016 at 5:58 AM, automenta notifications@github.com wrote:

https://github.com/opennars/opennars2/blob/2.0.0_postdev1/src/nal/deriver/truth.clj#L101

(t-and c1 c2)

https://github.com/opennars/opennars2/blob/2.0.0_postdev1/docs/NAL-spec/NAL-3.tex#L206

c &=& or(and(not(f_1), c_1), and(not(f_2), c_2)) + and(f_1, c_1, f_2, c_2)

the preceding paragraph in the NAL spec explains:

When T 1 and T 2 are either highly
similar or opposite to each other, the compound terms produced by these
rules may not have much practical value. However, even when it happens,
it is an issue to be handled by inference control, not by logic.
In the confidence functions, each case for the conclusion to reach its
maximum is separately considered. The plus operator is used in place of an
or operator, because the two cases involved are mutually exclusive, rather
than independent of each other.

i had suspected a symmetric form of this function was missing for negated
cases of certain truth functions. not only is the code missing the negated
case, inconsistent for the positive case, but i see a possible mistake
written for the unimplemented negated case. taking the intersection case as
an example

c = or(and(not(f 1 ), c 1 ), and(not(f 2 ), c 2 )) + and(f 1 , c 1 , f 2 ,
c 2 )

the first component of this formula alone can produce confidence values
higher than its conf inputs (ex: two 90% conf inputs producing a 98% conf
output in one test case). no other truth functions compute a confidence
combining freq and conf in an or( ) in this way.

my guess is that that '+' actually means max as the explanation seems to
suggest, and that one of these variations will produce more reasonable
confidence values for the various positive and negative combinations.

max(and(f1, f2, c1, c2), and( 1-f1, c1, 1-f2, c2 ))
max(and(f1, f2, c1, c2), and( or(1-f1, 1-f2), c1, c2 ))

otherwise please clarify the documentation and/or why the code seems
inconsistent for these functions (including opennars 1.x)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#62, or mute the thread
https://github.com/notifications/unsubscribe-auth/AHxfsRXTlufHoNw9VWP10Li1mdtAp46dks5qbe2KgaJpZM4JZjnz
.

@automenta
Copy link
Author

ok, thanks

@patham9 patham9 added this to the 2.0.1 milestone Aug 25, 2016
@patham9 patham9 modified the milestones: 2.0.1, 2.0.2 Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants