Search in sources :

Example 71 with TestNAR

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

the class NAL3Test method compound_composition_two_premises.

@Test
public void compound_composition_two_premises() {
    TestNAR tester = test;
    // .en("Swan is a type of swimmer.");
    tester.believe("(swan --> swimmer)", 0.9f, 0.9f);
    // .en("Swan is a type of bird.");
    tester.believe("(swan --> bird)", 0.8f, 0.9f);
    // .en("Swan is a type of bird or a type of swimmer.");
    tester.mustBelieve(cycles, "(swan --> (bird | swimmer))", 0.98f, 0.81f);
    // .en("Swan is a type of swimming bird.");
    tester.mustBelieve(cycles, "(swan --> (bird & swimmer))", 0.72f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 72 with TestNAR

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

the class NAL3Test method composition_on_both_sides_of_a_statement2_2.

@Test
public void composition_on_both_sides_of_a_statement2_2() 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)

Example 73 with TestNAR

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

the class NAL3Test method composition_on_both_sides_of_a_statement_2.

@Test
public void composition_on_both_sides_of_a_statement_2() throws Narsese.NarseseException {
    TestNAR tester = test;
    // .en("Bird is a type of animal.");
    tester.believe("<bird --> animal>", 0.9f, 0.9f);
    // .en("Is a swimming bird a type of swimming animal?");
    tester.ask("<(|,bird,swimmer) --> (|,animal,swimmer)>");
    // .en("A swimming bird is probably a type of swimming animal.");
    tester.mustBelieve(cycles, "<(|,bird,swimmer) --> (|,animal,swimmer)>", 0.90f, 0.73f);
/*<bird --> animal>. %0.9;0.9%
                <(|,bird,swimmer) --> (|,animal,swimmer)>?*/
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 74 with TestNAR

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

the class NAL5EquivTests method comparison2.

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

Example 75 with TestNAR

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

the class NAL5EquivTests method resemblance.

@Test
public void resemblance() {
    TestNAR tester = test;
    // tester.believe("<<robin --> animal> <=> <robin --> bird>>"); //.en("Robin is a type of animal if and only if robin is a type of bird.");
    // .en("Robin is a type of animal if and only if robin is a type of bird.");
    tester.believe("<<robin --> animal> ==> <robin --> bird>>");
    // .en("Robin is a type of animal if and only if robin is a type of bird.");
    tester.believe("<<robin --> bird> ==> <robin --> animal>>");
    // tester.believe("<<robin --> bird> <=> <robin --> [flying]>>", 0.9f, 0.9f); //.en("Robin is a type of bird if and only if robin can fly.");
    // .en("Robin is a type of bird if and only if robin can fly.");
    tester.believe("<<robin --> bird> ==> <robin --> [flying]>>", 0.9f, 0.9f);
    // .en("Robin is a type of bird if and only if robin can fly.");
    tester.believe("<<robin --> [flying]> ==> <robin --> bird>>", 0.9f, 0.9f);
    // tester.mustBelieve(cycles, " <<robin --> animal> <=> <robin --> [flying]>>", 0.90f, 0.81f); //.en("Robin is a type of animal if and only if robin can fly.");
    // .en("Robin is a type of animal if and only if robin can fly.");
    tester.mustBelieve(cycles, " <<robin --> animal> ==> <robin --> [flying]>>", 0.90f, 0.73f);
    // .en("Robin is a type of animal if and only if robin can fly.");
    tester.mustBelieve(cycles, " <<robin --> [flying]> ==> <robin --> animal>>", 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