/* * NARS-Examples-SingleStep.txt * Pei Wang [All Rights Reserved] * last modified: August 2007 * * Examples showing conclusions of single-step inference in the Java applet, * listed roughly in the order by which the rules are introduced into the logic * in the book "Rigid Flexibility: The Logic of Intelligence". * * Each example consists of a title, an input text, and selected output sentences, * separated by "--------------------". * * To show all derived sentences, select menu item "Parameter/Report Silence Level", * move the scrollbar to set the value to around 10, then click the "Hind" button. * * To run an example, do the following: * (1) reset the memory by selecting menu item "Memory/Initialize", * (2) copy the input text and paste it into the Input Window, e.g. for the first * example, it is the following two sentences plus one number: * swimmer>. * swimmer>. %0.1; 0.6% * 1 * (3) click the "OK" botton. The output text should include the given conclusion(s), * plus, for some examples, other conclusions produced by related rules. * * The user can edit an example, or make up new ones, according to the grammer * specified in the User's Guide of the NARS Applet. */ /* ---------- NAL-1 ---------- */ // revision swimmer>. swimmer>. %0.1; 0.6% 1 -------------------- swimmer>. %0.87;0.91% // deduction animal>. bird>. 1 -------------------- animal>. %1.00;0.81% // abduction competition>. competition>. %0.8% 1 -------------------- chess>. %1.00;0.39% sport>. %0.80;0.44% // induction swimmer>. %0.7% bird>. 1 -------------------- swimmer>. %0.70;0.44% bird>. %1.00;0.36% // answering "yes/no" question swimmer>. swimmer>? 1 -------------------- swimmer>. %1.00;0.90% // answering "what" question swimmer>. swimmer>? 1 -------------------- swimmer>. %1.00;0.90% // derived question swimmer>. swimmer>? 1 -------------------- bird>? ?1>? bird>? /* ---------- NAL-2 ---------- */ // comparison swimmer>. %0.7% bird>. 1 -------------------- swimmer>. %0.70;0.44% // analogy swimmer>. swan>. 1 -------------------- swimmer>. %1.00;0.72% // resemblance robin>. swan>. 1 -------------------- robin>. %1.00;0.81% // instance relation . -------------------- <{Tweety} --> bird> %1.00;0.90% // property relation . -------------------- [black]> %1.00;0.90% // instance-property relation . -------------------- <{Tweety} --> [yellow]> %1.00;0.90% // inheritance to similarity bird>. swan>. %0.1% 1 -------------------- swan>. %0.10;0.89% // set definition <{Tweety} --> {Birdie}>. 3 -------------------- <{Birdie} <-> {Tweety}>. %1.00;0.90% // set decomposition <{Tweety} <-> {Birdie}>. %0.9% 2 -------------------- Tweety>. %0.90;0.90% /* ---------- NAL-3 ---------- */ // compound composition, two premises swimmer>. %0.9% flyer>. %0.8% 1 -------------------- (|,flyer,swimmer)>. %0.98;0.96% (&,flyer,swimmer)>. %0.72;0.83% (-,swimmer,flyer)>. %0.18;0.89% (-,flyer,swimmer)>. %0.08;0.90% // compound decomposition (|,flyer,swimmer)>. swimmer>. %0% 4 -------------------- flyer>. %1.00;0.81% // set operations {Venus, Mars, Pluto}>. %0.9% {Pluto, Saturn}>. %0.8% 9 -------------------- {Mars,Pluto,Saturn,Venus}>.%0.98;0.96% {Pluto}>.%0.72;0.83% {Mars,Venus}>.%0.18;0.89% {Saturn}>.%0.08;0.90% /* ---------- NAL-4 ---------- */ // structural transformation <(*, acid, base) --> reaction>. 11 -------------------- (/,reaction,_,base)>. %1.00;0.90% (/,reaction,acid,_)>. %1.00;0.90% (/,reaction,_,base)>. 11 -------------------- <(*,acid,base) --> reaction>. %1.00;0.90% (/,reaction,acid,_)>. %1.00;0.90% (/,reaction,acid,_)>. 11 -------------------- (/,reaction,_,base)>. %1.00;0.90% <(*,acid,base) --> reaction>. %1.00;0.90% /* ---------- NAL-5 ---------- */ // deduction < bird> ==> animal>>. < flyer> ==> bird>>. %0.7;0.8% 25 -------------------- < flyer> ==> animal>>. %0.70;0.50% < bird> ==> animal>>. bird>. 1 -------------------- animal>. %1.00;0.81% // induction < bird> ==> animal>>. < bird> ==> flyer>>. %0.8% 24 -------------------- < flyer> ==> animal>>. %1.00;0.39% < animal> ==> flyer>>. %0.80;0.44% // abduction < bird> ==> animal>>. %0.7% < flyer> ==> animal>>. 25 -------------------- < bird> ==> flyer>>. %0.70;0.44% < flyer> ==> bird>>. %1.00;0.36% < bird> ==> animal>>. %0.7% animal>. 1 -------------------- bird>. %1.00;0.36% // compound composition < bird> ==> animal>>. %0.9% < bird> ==> flyer>>. %0.8% 24 -------------------- < bird> ==> (||, animal>, flyer>)>. %0.98;0.96% < bird> ==> (&&, animal>, flyer>)>. %0.72;0.83% < bird> ==> (&&,(--, flyer>), animal>)>. %0.18;0.89% < bird> ==> (&&,(--, animal>), flyer>)>. %0.08;0.90% // compound decomposition < bird> ==> (&&, animal>, swimmer>)>. %0% < bird> ==> animal>>. 21 -------------------- < bird> ==> swimmer>>. %0.00;0.81% // negation (--, flyer>). %0.1% 1 -------------------- flyer>. %0.90;0.90% // contraposition <(--, bird>) ==> flyer>>. %0.1% 11 -------------------- <(--, flyer>) ==> bird>>. %0.00;0.44% /* ---------- NAL-6 ---------- */ // variable unification <<#x --> bird> ==> <#x --> flyer>>. <<#y --> bird> ==> <#y --> flyer>>. %0; 0.7% 1 -------------------- <<#1 --> bird> ==> <#1 --> flyer>>. %0.79;0.91% <<#x --> bird> ==> <#x --> animal>>. <<#y --> robin> ==> <#y --> bird>>. 1 -------------------- <<#1 --> robin> ==> <#1 --> animal>>. %1.00;0.81% <<#1 --> animal> ==> <#1 --> robin>>. %1.00;0.44% // variable elimination <<#x --> bird> ==> <#x --> animal>>. bird>. 1 -------------------- animal>. %1.00;0.81% (&&,<#x() --> bird>,<#x() --> swimmer>). bird>. %0.9% 1 -------------------- swimmer>. %1.00;0.42% // variable introduction bird>. swimmer>. %0.8% 1 -------------------- <<#1 --> swimmer> ==> <#1 --> bird>>. %1.00;0.39% <<#1 --> bird> ==> <#1 --> swimmer>>. %0.80;0.44% <<#1 --> bird> <=> <#1 --> swimmer>>. %0.80;0.44% (&&,<#1() --> bird>,<#1() --> swimmer>). %0.80;0.82% swimmer>. swimmer>. %0.8% 1 -------------------- < #1> ==> #1>>. %1.00;0.39% < #1> ==> #1>>. %0.80;0.44% < #1> <=> #1>>. %0.80;0.44% (&&, #1()>, #1()>). %0.80;0.82% /* ---------- NAL-7 ---------- */ // temporal inference <<(*, #x, room_101) --> enter> =\> <(*, #x, door_101) --> open>>. %0.9% <<(*, #y, door_101) --> open> =\> <(*, #y, key_101) --> hold>>. %0.8% 48 -------------------- <<(*,#1,room_101) --> enter> =\> <(*,#1,key_101) --> hold>>. %0.72;0.58% <<(*,#1,key_101) --> hold> =/> <(*,#1,room_101) --> enter>>. %1.00;0.36% <<(*, #x, door_101) --> open> =/> <(*, #x, room_101) --> enter>>. %0.95% <<(*, #x, room_101) --> enter> <|> <(*, #x, corridor_100) --> leave>>. 61 -------------------- <<(*,#1,door_101) --> open> =/> <(*,#1,corridor_100) --> leave>>. %0.95;0.72% // inference on tense <<(*, #x, key_101) --> hold> =/> <(*, #x, room_101) --> enter>>. %0.7% (/>, <(*, John, key_101) --> hold>). 1 -------------------- (/>,<(*,John,room_101) --> enter>). %0.70;0.56% <<(*, #x, key_101) --> hold> =/> <(*, #x, room_101) --> enter>>. %0.7% (|>, <(*, John, room_101) --> enter>). 1 -------------------- (\>,<(*,John,key_101) --> hold>). %0.70;0.44% /* ---------- NAL-8 ---------- */ // goal revision (/,inside,_,room_101)>! (/,inside,_,room_101)>! %0; 0.60% 1 --------------------------------- (/,inside,_,room_101)>! %0.85;0.91% // goal derivation <(*, John, room_101) --> enter>! <<(*, #x, key_101) --> hold> =/> <(*, #x, room_101) --> enter>>. %0.7% 1 ---------------- <(*,John,key_101) --> hold>! %0.70;0.56%