Help with Narsese

44 views
Skip to first unread message

Christopher

unread,
May 15, 2024, 11:15:24 PMMay 15
to open-nars

Hello,

Can you please tell me what am I doing wrong here?


// ariel is father of chris

( ariel * chris ) --> father_of >.


// chris is father of angel

< ( chris * angel ) --> father_of >.


// Definition of grandpa

<($1 * $3) --> grandpa_of> <=> (&&, <($1 * $2) --> father_of>, <($2 * $3) --> father_of>)>.


100


// who is grandpa of angel?

< ( ?1 * angel ) --> grandpa_of >?


// Answer: None.

// Expect

ed anwer: ariel



Pei Wang

unread,
May 16, 2024, 1:11:14 AMMay 16
to open-nars
Change $2 to #2

Christopher Pereira

unread,
May 16, 2024, 3:55:47 AMMay 16
to open-nars
I tried (with no success):


< ( ariel * chris ) --> father_of >.
< ( chris * angel ) --> father_of >.
< ($1 * $3) --> grandpa_of> <=> (&&, <($1 * #2) --> father_of>, <(#2 * $3) --> father_of>)>.
< (ariel * angel) --> grandpa_of >?

I also tried many other variations of the "grandpa definition rule" (with no success):

< (#1 * #3) --> grandpa_of> <=> (&&, <(#1 * $2) --> father_of>, <($2 * #3) --> father_of>)>.

What works (but is not the same) is:

< (ariel * angel) --> grandpa_of> <=> (&&, <(ariel * $2) --> father_of>, <($2 * angel) --> father_of>)>.
< (ariel * angel) --> grandpa_of> <=> (&&, <(ariel * #2) --> father_of>, <(#2 * angel) --> father_of>)>.

It seems like the variables expansion is not working inside a conjunction?

Patrick Hammer

unread,
Jun 5, 2024, 3:19:35 AMJun 5
to open-nars
Hi!

Your original example had issues with parentheses.
It works fine with ONA:

<(ariel * chris) --> father_of >.
<(chris * angel) --> father_of >.
<<($1 * $3) --> grandpa_of> <=> (<($1 * #2) --> father_of> && <(#2 * $3) --> father_of>)>.

<(ariel * angel) --> grandpa_of >?
//Answer: <(ariel * angel) --> grandpa_of>. creationTime=3 Stamp=[3,2,1] Truth: frequency=1.000000, confidence=0.729000

I couldn't make it work with OpenNARS though even after changing it to its required operator prefix notation, probably due to a inference rule bug that would need to be investigated.
Please let us know which system you are running.

Best regards,
Patrick

Christopher Pereira

unread,
Jun 5, 2024, 8:26:48 AMJun 5
to open-nars
Thanks Patrick.
I'm testing ONA (works) and PyNARS (doesn't work, but they are replacing the inference engine anyway).

Reply all
Reply to author
Forward
0 new messages