use of nars.test.TestNAR in project narchy by automenta.
the class NAL8EquivalenceTest method conjunctionSubstitutionViaEquivSimultaneous.
@Test
public void conjunctionSubstitutionViaEquivSimultaneous() {
TestNAR tester = test;
// ETERNAL or Zero, for now dont allow time relation
tester.input("(a:b <=>+0 c:d).");
// PRESENT
tester.input("(c:d &&+0 e:f). :|:");
tester.mustBelieve(cycles, "(a:b &&+0 e:f)", 1.0f, 0.81f, 0);
tester.mustNotOutput(cycles, "(a:b &&+0 e:f)", BELIEF, ETERNAL);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL8Test method testDesiredConjPos.
@Test
public void testDesiredConjPos() {
TestNAR t = test;
t.believe("(x)").goal("((x)&&(y))").mustGoal(cycles, "(y)", 1f, 0.81f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL8Test method testBelievedImplOfDesire.
@Test
public void testBelievedImplOfDesire() {
TestNAR t = test;
t.goal("(x)").believe("((x)==>(y))").mustGoal(cycles, "(y)", 1f, 0.81f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class BeliefTableTest method testDurationDithering.
@Test
public void testDurationDithering() {
NAR n = NARS.tmp();
n.dtDither.set(1f);
n.time.dur(3);
TestNAR t = new TestNAR(n);
t.confTolerance(0.1f);
t.inputAt(1, "x. :|:");
t.inputAt(2, "y. :|:");
t.mustBelieve(5, "(x&|y)", 1f, 0.81f, 1);
t.mustBelieve(5, "(x=|>y)", 1f, 0.45f, 1);
t.test(true);
// assertEquals( $.$("((x) &| (y))"), n.term("((x) &&+1 (y))"));
// assertEquals( $.$("((x) &| (y))"), n.term("((x) &&-1 (y))"));
// assertEquals( "(&|,(x),(y),(z))", n.term("(((x) &&+1 (y)) &&+1 (z))").toString());
// assertEquals( $.$("((x) &&+6 (y))"), n.term("((x) &&+6 (y))"));
// assertEquals( $.$("((x) =|> (y))"), n.term("((x) ==>+1 (y))"));
// // assertEquals( $.$("((x) <|> (y))"), n.term("((x) <=>+1 (y))"));
}
use of nars.test.TestNAR in project narchy by automenta.
the class ArithmeticTest method testCompleteAddInduction.
@Test
public void testCompleteAddInduction() throws Narsese.NarseseException {
NAR n = NARS.tmp();
new ArithmeticIntroduction(16, n);
TestNAR t = new TestNAR(n);
t.confTolerance(0.8f);
t.log();
// t.believe("(x:1,x:2)");
// t.believe("(x:2,x:3)");
// t.believe("(x:3,x:4)");
// t.believe("(x:4,x:5)");
// t.ask("(x:5,?1)");
// t.mustBelieve(1000, "(x:5,x:6)", 1f, 0.81f);
t.believe("(a,1)");
t.believe("(a,2)");
t.believe("(a,3)");
t.believe("(a,4)");
t.ask("(a,#x)");
t.mustBelieve(1000, // "((a,add(#1,1))&&(#1<->4))",
"((a,add($1,1))==>(#1<->4))", 1f, 0.81f);
t.mustBelieve(1000, "(a,5)", 1f, 0.81f);
t.test(true);
}
Aggregations