use of nars.test.TestNAR in project narchy by automenta.
the class NAL4MultistepTest method nal4_everyday_reasoning.
@Test
public void nal4_everyday_reasoning() {
int time = 3500;
// Global.DEBUG = true;
TestNAR tester = test;
tester.nar.freqResolution.set(0.1f);
// tester.log();
// (({tom},{sky})-->likes). <{tom} --> cat>. <({tom},{sky}) --> likes>. <(cat,[blue]) --> likes>?
// en("the sky is blue");
tester.input("<{sky} --> [blue]>.");
// en("tom is a cat");
tester.input("<{tom} --> cat>.");
// en("tom likes the sky");
tester.input("likes({tom},{sky}).");
// cats like blue?
tester.input("$0.9 likes(cat,[blue])?");
// return mustOutput(cycleStart, cycleEnd, sentenceTerm, punc, freqMin, freqMax, confMin, confMax, occTimeAbsolute, occTimeAbsolute);
tester.mustBelieve(time, "likes(cat,[blue])", 1f, 0.16F);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL4MultistepTest method nal4_everyday_reasoning_easier.
@Test
@Disabled
public void nal4_everyday_reasoning_easier() throws Narsese.NarseseException {
int time = 2550;
// Global.DEBUG = true;
TestNAR tester = test;
// tester.nar.log();
// en("the sky is blue");
tester.believe("<sky --> blue>", 1.0f, 0.9f);
// en("tom is a cat");
tester.believe("<tom --> cat>", 1.0f, 0.9f);
// en("tom likes the sky");
tester.believe("<(tom,sky) --> likes>", 1.0f, 0.9f);
// cats like blue?
tester.ask("<(cat,blue) --> likes>");
// tester.askAt(time/3, "<(cat,blue) --> likes>"); //cats like blue?
// tester.askAt(time/2, "<(cat,blue) --> likes>"); //cats like blue?
// en("A base is something that has a reaction with an acid.");
tester.mustBelieve(time, "<(cat,blue) --> likes>", 1.0f, 0.42f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method conditional_induction0.
@Test
public void conditional_induction0() {
// //((&&,M,A..+) ==> C), ((&&,B,A..+)==>C) |- (B ==>+- M), (Belief:Induction)
TestNAR tester = test;
tester.believe("((&&,x1,x2,a) ==> c)");
tester.believe("((&&,y1,y2,a) ==> c)");
tester.mustBelieve(cycles, "((x1&&x2) ==> (y1&&y2))", 1.00f, 0.45f);
tester.mustBelieve(cycles, "((y1&&y2) ==> (x1&&x2))", 1.00f, 0.45f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method abduction.
// @Test
// public void inductionNegNeg() {
// TestNAR tester = test;
// tester.believe("<<robin --> bird> ==> --<robin --> cyborg>>"); //.en("If robin is a type of bird then robin is not of type cyborg.");
// tester.believe("<<robin --> [flying]> ==> --<robin --> cyborg>>", 0.8f, 0.9f); //.en("If robin can fly then robin is probably not of type cyborg.");
// tester.mustBelieve(cycles, "<<robin --> bird> ==> <robin --> [flying]>>", 1.00f, 0.39f); //.en("I guess if robin is a type of bird then robin can fly.");
// tester.mustBelieve(cycles, "<<robin --> [flying]> ==> <robin --> bird>>", 0.80f, 0.45f); //.en("I guess if robin can fly then robin is a type of bird.");
//
// }
@Test
public void abduction() {
/*
<<robin --> bird> ==> <robin --> animal>>. // If robin is a type of bird then robin is a type of animal.
<<robin --> bird> ==> <robin --> [flying]>>. %0.80% // If robin is a type of bird then robin can fly.
14
OUT: <<robin --> [flying]> ==> <robin --> animal>>. %1.00;0.39% // I guess if robin can fly then robin is a type of animal.
OUT: <<robin --> animal> ==> <robin --> [flying]>>. %0.80;0.45% // I guess if robin is a type of animal then robin can fly.
*/
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 is a type of bird then robin can fly.");
tester.believe("<<robin --> bird> ==> <robin --> [flying]>>", 0.8f, 0.9f);
// .en("I guess if robin can fly then robin is a type of animal.");
tester.mustBelieve(cycles, "<<robin --> [flying]> ==> <robin --> animal>>", 1.00f, 0.39f);
// .en("I guess if robin is a type of animal then robin can fly.");
tester.mustBelieve(cycles, "<<robin --> animal> ==> <robin --> [flying]>>", 0.80f, 0.45f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method conditional_induction0SimpleDepVar2.
@Test
public void conditional_induction0SimpleDepVar2() {
TestNAR tester = test;
tester.believe("((&&,x1,#1) ==> (a && #1))");
tester.believe("((&&,y1,#1) ==> (a && #1))");
tester.mustBelieve(cycles, "(x1 ==> y1)", 1.00f, 0.45f);
tester.mustBelieve(cycles, "(y1 ==> x1)", 1.00f, 0.45f);
}
Aggregations