Search in sources :

Example 66 with TestNAR

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

the class NAL3Test method compound_composition_one_premise2.

@Test
public void compound_composition_one_premise2() throws Narsese.NarseseException {
    TestNAR tester = test;
    // .en("Swan is a type of bird.");
    tester.believe("<swan --> bird>", 0.9f, 0.9f);
    // .en("Is swimming swan a type of bird?");
    tester.ask("<(&,swan,swimmer) --> bird>");
    // .en("Swimming swan is a type of bird.");
    tester.mustBelieve(cycles, "<(&,swan,swimmer) --> bird>", 0.90f, 0.73f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 67 with TestNAR

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

the class NAL3Test method compound_decomposition_one_premise2.

@Test
public void compound_decomposition_one_premise2() {
    TestNAR tester = test;
    // .en("Boys and girls are youth.");
    tester.believe("<(boy | girl) --> youth>", 0.9f, 0.9f);
    // .en("Boys are youth.");
    tester.mustBelieve(cycles * 2, "<boy --> youth>", 0.90f, 0.73f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 68 with TestNAR

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

the class NAL3Test method compound_composition_two_premises2.

@Test
public void compound_composition_two_premises2() {
    TestNAR tester = test;
    // .en("Sport is a type of competition.");
    tester.believe("<sport --> competition>", 0.9f, 0.9f);
    // .en("Chess is a type of competition.");
    tester.believe("<chess --> competition>", 0.8f, 0.9f);
    // .en("If something is either chess or sport, then it is a competition.");
    tester.mustBelieve(cycles, "<(|,chess,sport) --> competition>", 0.72f, 0.81f);
    // .en("If something is both chess and sport, then it is a competition.");
    tester.mustBelieve(cycles, "<(&,chess,sport) --> competition>", 0.98f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 69 with TestNAR

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

the class NAL3Test method compound_decomposition_two_premises.

@Test
public void compound_decomposition_two_premises() {
    TestNAR tester = test;
    // .en("Robin is a type of bird or a type of swimmer.");
    tester.believe("<robin --> (|,bird,swimmer)>", 1.0f, 0.9f);
    // .en("Robin is not a type of swimmer.");
    tester.believe("<robin --> swimmer>", 0.0f, 0.9f);
    // .en("Robin is a type of bird.");
    tester.mustBelieve(cycles, "<robin --> bird>", 1.0f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 70 with TestNAR

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

the class NAL3Test method composition_on_both_sides_of_a_statement2.

@Test
public void composition_on_both_sides_of_a_statement2() throws Narsese.NarseseException {
    TestNAR tester = test;
    // .en("Bird is a type of animal.");
    tester.believe("<bird --> animal>", 0.9f, 0.9f);
    // .en("Is a nonanimal swimmer a type of a nonbird swimmer?");
    tester.ask("<(-,swimmer,animal) --> (-,swimmer,bird)>");
    // .en("A nonanimal swimmer is probably a type of nonbird swimmer.");
    tester.mustBelieve(cycles, "<(-,swimmer,animal) --> (-,swimmer,bird)>", 0.90f, 0.73f);
}
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