Search in sources :

Example 6 with TestNAR

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

the class NAL5Test method exemplification.

@Test
public void exemplification() {
    TestNAR tester = test;
    // .en("If robin can fly then robin is a type of bird.");
    tester.believe("<<robin --> [flying]> ==> <robin --> bird>>");
    // .en("If robin is a type of bird then robin is a type of animal.");
    tester.believe("<<robin --> bird> ==> <robin --> animal>>");
    // .en("I guess if robin is a type of animal then robin can fly.");
    tester.mustBelieve(cycles, "<<robin --> animal> ==> <robin --> [flying]>>.", 1.00f, 0.45f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 7 with TestNAR

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

the class NAL5Test method compound_decomposition_two_premises3.

@Test
public void compound_decomposition_two_premises3() {
    TestNAR tester = test;
    // .en("Robin can fly or swim.");
    tester.believe("(||,<robin --> [flying]>,<robin --> swimmer>)");
    // .en("Robin cannot swim.");
    tester.believe("<robin --> swimmer>", 0.0f, 0.9f);
    // .en("Robin can fly.");
    tester.mustBelieve(cycles, "<robin --> [flying]>", 1.00f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 8 with TestNAR

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

the class NAL5Test method conditional_induction0SimpleIndepVar.

@Test
public void conditional_induction0SimpleIndepVar() {
    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);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 9 with TestNAR

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

the class NAL5Test method compound_composition_one_premises.

/**
 * not sure this one makes logical sense
 */
@Disabled
@Test
public void compound_composition_one_premises() throws nars.Narsese.NarseseException {
    TestNAR tester = test;
    // .en("Robin can fly.");
    tester.believe("<robin --> [flying]>");
    // .en("Can robin fly or swim?");
    tester.ask("(||,<robin --> [flying]>,<robin --> swimmer>)");
    // tester.mustBelieve(cycles*2," (||,<robin --> swimmer>,<robin --> [flying]>)",1.00f,0.81f); //.en("Robin can fly or swim.");
    // .en("Robin can fly or swim.");
    tester.mustBelieve(cycles * 2, " (&&,(--,<robin --> swimmer>),(--,<robin --> [flying]>))", 0.00f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest) Disabled(org.junit.jupiter.api.Disabled)

Example 10 with TestNAR

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

the class NAL5Test method compound_composition_Pred.

@Test
public void compound_composition_Pred() {
    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.9f, 0.9f);
    // .en("If robin is a type of bird then usually robin is a type of animal and can fly.");
    tester.mustBelieve(cycles, " <<robin --> bird> ==> (&&,<robin --> [flying]>,<robin --> animal>)>", 0.90f, 0.81f);
// tester.mustBelieve(cycles,
// "((robin-->bird)==>((--,(robin-->animal))&&(--,(robin-->[flying]))))", 0f, 0.81f);
// " <<robin --> bird> ==> (||,<robin --> [flying]>,<robin --> animal>)>",1.00f,0.81f); //.en("If robin is a type of bird then robin is a type of animal or can fly.");
}
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