Search in sources :

Example 16 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class NAL5Test method compound_decomposition_one_premise_pos.

@Test
public void compound_decomposition_one_premise_pos() {
    TestNAR tester = test;
    // .en("Robin cannot be both a flyer and a swimmer.");
    tester.believe("(<robin --> [flying]> && <robin --> swimmer>)", 1.0f, 0.9f);
    // .en("Robin cannot swim.");
    tester.mustBelieve(cycles, "<robin --> swimmer>", 1.00f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 17 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class NAL5Test method conditional_induction0NegBothSimple.

@Test
public void conditional_induction0NegBothSimple() {
    TestNAR tester = test;
    tester.believe("--((x&&a) ==> c)");
    tester.believe("--((x&&b) ==> c)");
    tester.mustBelieve(cycles, "(a ==> b)", 1.00f, 0.45f);
    tester.mustBelieve(cycles, "(b ==> a)", 1.00f, 0.45f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 18 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class NAL5Test method compound_decomposition_two_premises1.

// @Test
// public void compound_composition_SubjPosNeg() {
// test
// .believe("<<robin --> bird> ==> <robin --> animal>>") //.en("If robin is a type of bird then robin is a type of animal.")
// .believe("--<<robin --> [alien]> ==> <robin --> animal>>") //.en("If robin is alien then robin isnt a type of animal.");
// .mustBelieve(cycles, " <(&&,<robin --> bird>, --<robin --> [alien]>) ==> <robin --> animal>>", 1f, 0.81f); //.en("If robin isnt alien and is a type of bird then robin is a type of animal.");
// }
@Test
public void compound_decomposition_two_premises1() {
    TestNAR tester = test;
    // .en("If robin is a type of bird then robin is not a type of flying animal.");
    tester.believe("--(bird:robin ==> (animal:robin && [flying]:robin))", 1.0f, 0.9f);
    // .en("If robin is a type of bird then robin can fly.");
    tester.believe("(bird:robin ==> [flying]:robin)");
    // .en("It is unlikely that if a robin is a type of bird then robin is a type of animal.");
    tester.mustBelieve(cycles * 2, "--(bird:robin ==> animal:robin)", 1.00f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 19 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class NAL5Test method conditional_induction0SimpleDepVar.

@Test
public void conditional_induction0SimpleDepVar() {
    TestNAR tester = test;
    tester.believe("((&&,x1,#1) ==> c)");
    tester.believe("((&&,y1,#1) ==> c)");
    tester.mustBelieve(cycles, "(x1 ==> y1)", 1.00f, 0.45f);
    tester.mustBelieve(cycles, "(y1 ==> x1)", 1.00f, 0.45f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 20 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class NAL6Test method variable_unification7.

@Test
public void variable_unification7() {
    TestNAR tester = test;
    // en("If something can fly and eats worms, then it is a bird.");
    tester.believe("<(&&,<$x --> flyer>,<($x,worms) --> food>) ==> <$x --> bird>>");
    // en("If something can fly, then it has wings.");
    tester.believe("<<$y --> flyer> ==> <$y --> [withWings]>>");
    // en("If something has wings and eats worms, then I guess it is a bird.");
    tester.mustBelieve(cycles, "<(&&,<$1 --> [withWings]>,<($1,worms) --> food>) ==> <$1 --> bird>>", 1.00f, 0.45f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Aggregations

TestNAR (nars.test.TestNAR)178 Test (org.junit.jupiter.api.Test)169 NALTest (nars.util.NALTest)162 NAL7Test (nars.nal.nal7.NAL7Test)18 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)11 Disabled (org.junit.jupiter.api.Disabled)5 NAR (nars.NAR)2 Concept (nars.concept.Concept)2 DoubleSummaryStatistics (java.util.DoubleSummaryStatistics)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 BiFunction (java.util.function.BiFunction)1 IntFunction (java.util.function.IntFunction)1 nars (nars)1 NARS (nars.NARS)1 TaskStatistics (nars.task.util.TaskStatistics)1 Term (nars.term.Term)1 DeductiveMeshTest (nars.test.DeductiveMeshTest)1 ETERNAL (nars.time.Tense.ETERNAL)1 NotNull (org.jetbrains.annotations.NotNull)1 Assertions.assertNotEquals (org.junit.jupiter.api.Assertions.assertNotEquals)1