Search in sources :

Example 26 with TestNAR

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

the class NAL6Test method variable_elimination5.

@Test
public void variable_elimination5() {
    TestNAR tester = test;
    // en("Tweety has wings.");
    tester.believe("<{Tweety} --> [withWings]>");
    // en("If something can chirp and has wings, then it is a bird.");
    tester.believe("<(&&,<$x --> [chirping]>,<$x --> [withWings]>) ==> <$x --> bird>>");
    // en("If Tweety can chirp, then it is a bird.");
    tester.mustBelieve(cycles, "<<{Tweety} --> [chirping]> ==> <{Tweety} --> bird>>", 1.00f, 0.73f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 27 with TestNAR

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

the class NAL6Test method testSimpleIndepUnification.

@Test
public void testSimpleIndepUnification() {
    TestNAR t = test;
    t.input("(<$x --> y> ==> <$x --> z>).");
    t.input("(x --> y).");
    t.mustBelieve(cycles, "(x --> z)", 1.0f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 28 with TestNAR

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

the class NAL6Test method multiple_variable_elimination.

@Test
public void multiple_variable_elimination() {
    TestNAR tester = test;
    // en("Every lock can be opened by every key.");
    tester.believe("((($x --> key) && ($y --> lock)) ==> open($x, $y))");
    // en("Lock-1 is a lock.");
    tester.believe("({lock1} --> lock)");
    // en("Lock-1 can be opened by every key.");
    tester.mustBelieve(cycles * 3, "(($1 --> key) ==> open($1, {lock1}))", 1.00f, 0.73f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 29 with TestNAR

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

the class NAL6Test method variable_introduction3.

@Test
@Disabled
public void variable_introduction3() {
    TestNAR tester = test;
    // en("A gull is a swimmer.");
    tester.believe("<gull --> swimmer>", 1f, 0.9f);
    // en("A swan is never a swimmer.");
    tester.believe("<swan --> swimmer>", 0f, 0.9f);
    // en("Gull and swan have no commonality.");
    tester.mustBelieve(cycles, "(&&,<gull --> #1>,<swan --> #1>)", 0.0f, 0.81f);
    // en("Gull and non-swans have commonality.");
    tester.mustBelieve(cycles, "(&&,<gull --> #1>,(--,<swan --> #1>))", 1.0f, 0.81f);
// tester.mustBelieve(cycles, "<<gull --> $1> ==> <swan --> $1>>", 0.80f, 0.45f); //en("I guess what can be said about gull usually can also be said about swan.");
// tester.mustBelieve(cycles, "<<swan --> $1> ==> <gull --> $1>>", 1.00f, 0.39f); //en("I guess what can be said about swan can also be said about gull.");
// tester.mustBelieve(cycles, "<<gull --> $1> <=> <swan --> $1>>", 0.80f, 0.45f); //en("I guess gull and swan share most properties.");
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest) Disabled(org.junit.jupiter.api.Disabled)

Example 30 with TestNAR

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

the class NAL6Test method implVariableSubst.

@Test
public void implVariableSubst() {
    TestNAR tester = test;
    tester.believe("x:y.");
    tester.believe("(x:$y==>$y:x).");
    // en("there is a lock which is opened by key1");
    tester.mustBelieve(cycles, "y:x", 1.00f, 0.81f);
}
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