use of nars.test.TestNAR in project narchy by automenta.
the class NAL4MultistepTest method nal4_everyday_reasoning_easiest.
@Test
public void nal4_everyday_reasoning_easiest() throws Narsese.NarseseException {
int time = 550;
// Global.DEBUG = true;
TestNAR tester = test;
// en("the sky is blue");
tester.believe("<sky --> blue>", 1.0f, 0.9f);
// tester.believe("<tom --> cat>",1.0f,0.9f); //en("tom is a cat");
// tester.believe("<(tom,sky) --> likes>",1.0f,0.9f); //en("tom likes the sky");
// en("tom likes the sky");
tester.believe("<sky --> likes>", 1.0f, 0.9f);
// tester.ask("<(cat,blue) --> likes>"); //cats like blue?
// tester.askAt(time/3, "<(cat,blue) --> likes>"); //cats like blue?
// tester.askAt(time/2, "<(cat,blue) --> likes>"); //cats like blue?
// cats like blue?
tester.ask("<blue --> likes>");
// tester.mustBelieve(time, "<(cat,blue) --> likes>", 1.0f, 0.42f);
tester.mustBelieve(time, "<blue --> likes>", 1.0f, 0.4f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method induction.
@Test
public void induction() {
/*
<<robin --> bird> ==> <robin --> animal>>. // If robin is a type of bird then robin is a type of animal.
<<robin --> [flying]> ==> <robin --> animal>>. %0.8% // If robin can fly then robin is probably a type of animal.
OUT: <<robin --> bird> ==> <robin --> [flying]>>. %1.00;0.39% // I guess if robin is a type of bird then robin can fly.
OUT: <<robin --> [flying]> ==> <robin --> bird>>. %0.80;0.45% // I guess if robin can fly then robin is a type of bird.
*/
TestNAR tester = test;
// .en("If robin is a type of bird then robin is a type of animal.");
tester.believe("<<robin --> bird> ==> <robin --> animal>>");
// .en("If robin can fly then robin is probably a type of animal.");
tester.believe("<<robin --> [flying]> ==> <robin --> animal>>", 0.8f, 0.9f);
// .en("I guess if robin is a type of bird then robin can fly.");
tester.mustBelieve(cycles, "<<robin --> bird> ==> <robin --> [flying]>>", 1.00f, 0.39f);
// .en("I guess if robin can fly then robin is a type of bird.");
tester.mustBelieve(cycles, "<<robin --> [flying]> ==> <robin --> bird>>", 0.80f, 0.45f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method compound_composition_Subj.
@Test
public void compound_composition_Subj() {
TestNAR tester = test;
// .en("If robin is a type of bird then robin is a type of animal.");
tester.believe("<<robin --> bird> ==> <robin --> animal>>");
// .en("If robin can fly then robin is a type of animal.");
tester.believe("<<robin --> [flying]> ==> <robin --> animal>>", 0.9f, 0.81f);
// .en("If robin can fly and is a type of bird then robin is a type of animal.");
tester.mustBelieve(cycles, " <(&&,<robin --> bird>, <robin --> [flying]>) ==> <robin --> animal>>", 0.9f, 0.73f);
// tester.mustBelieve(cycles," <(||,<robin --> bird>, <robin --> [flying]>) ==> <robin --> animal>>",0.9f /*1f ? */,0.73f); //.en("If robin can fly or is a type of bird then robin is a type of animal.");
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method conditional_abduction3.
@Test
public void conditional_abduction3() {
TestNAR tester = test;
// .en("If robin can fly and it has wings, then robin is living.");
tester.believe("<(&&,<robin --> [flying]>,<robin --> [withWings]>) ==> <robin --> [living]>>", 0.9f, 0.9f);
// .en("If robin can fly and robin is a bird then robin is living.");
tester.believe("<(&&,<robin --> [flying]>,<robin --> bird>) ==> <robin --> [living]>>");
tester.mustBelieve(cycles * 2, "<<robin --> bird> ==> <robin --> [withWings]>>", // 0.90f,0.45f);
1.00f, // .en("I guess if robin is a bird, then robin has wings.");
0.42f);
tester.mustBelieve(cycles * 2, "<<robin --> [withWings]> ==> <robin --> bird>>", 0.90f, // .en("I guess if robin has wings, then robin is a bird.");
0.45f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method conditional_induction0Simple.
@Test
public void conditional_induction0Simple() {
TestNAR tester = test;
tester.believe("((&&,x1,a) ==> c)");
tester.believe("((&&,y1,a) ==> c)");
tester.mustBelieve(cycles, "(x1 ==> y1)", 1.00f, 0.45f);
tester.mustBelieve(cycles, "(y1 ==> x1)", 1.00f, 0.45f);
}
Aggregations