Search in sources :

Example 41 with Compound

use of nars.term.Compound in project narchy by automenta.

the class RevisionTest method testIntermpolationOrderMixDternal.

@Test
public void testIntermpolationOrderMixDternal() throws Narsese.NarseseException {
    Compound a = $.$("(a &&+1 (b &&+1 c))");
    Compound b = $.$("(a &&+1 (b && c))");
    permuteChoose(a, b, "[(a &&+1 (b&&c))]");
}
Also used : Compound(nars.term.Compound) Test(org.junit.jupiter.api.Test)

Example 42 with Compound

use of nars.term.Compound in project narchy by automenta.

the class RevisionTest method testIntermpolationWrongOrderSoDternalOnlyOption.

@Test
public void testIntermpolationWrongOrderSoDternalOnlyOption() throws Narsese.NarseseException {
    Compound a = $.$("(((right-->tetris) &&+5 (rotCW-->tetris)) &&+51 (tetris-->[happy]))");
    Compound b = $.$("(((tetris-->[happy])&&(right-->tetris)) &&+11 (rotCW-->tetris))");
    permuteChoose(a, b, "[(&&,(tetris-->[happy]),(right-->tetris),(rotCW-->tetris))]");
}
Also used : Compound(nars.term.Compound) Test(org.junit.jupiter.api.Test)

Example 43 with Compound

use of nars.term.Compound in project narchy by automenta.

the class RevisionTest method testIntermpolation2.

@Test
public void testIntermpolation2() throws Narsese.NarseseException {
    Compound f = $.$("(a &&+1 b)");
    Compound g = $.$("(a &&-1 b)");
    permuteChoose(f, g, "[(a&&b)]");
    Compound h = $.$("(a &&+1 b)");
    Compound i = $.$("(a &| b)");
    permuteChoose(h, i, "[(a&|b), (a &&+1 b)]");
}
Also used : Compound(nars.term.Compound) Test(org.junit.jupiter.api.Test)

Example 44 with Compound

use of nars.term.Compound in project narchy by automenta.

the class PatternCompoundTest method testEqualityWithNonPatternDT.

@Test
public void testEqualityWithNonPatternDT() throws Narsese.NarseseException {
    for (String s : new String[] { "(a ==> b)", "(a ==>+1 b)", "(a &&+1 b)" }) {
        Compound t = $(s);
        Compound p = (Compound) i.get(t, true).term();
        assertEquals(t.dt(), p.dt());
        assertEquals(t, p);
    }
}
Also used : Compound(nars.term.Compound) Test(org.junit.jupiter.api.Test)

Example 45 with Compound

use of nars.term.Compound in project narchy by automenta.

the class PatternCompoundTest method testPatternCompoundWithXTERNAL.

@Test
public void testPatternCompoundWithXTERNAL() throws Narsese.NarseseException {
    Compound p = (Compound) i.get($("((x) ==>+- (y))"), true).term();
    assertEquals(XTERNAL, p.dt());
}
Also used : Compound(nars.term.Compound) Test(org.junit.jupiter.api.Test)

Aggregations

Compound (nars.term.Compound)58 Test (org.junit.jupiter.api.Test)38 Term (nars.term.Term)20 Unify (nars.term.subst.Unify)3 FasterList (jcog.list.FasterList)2 XorShift128PlusRandom (jcog.math.random.XorShift128PlusRandom)2 Op (nars.Op)2 PatternCompound (nars.derive.PatternCompound)2 PatternIndex (nars.index.term.PatternIndex)2 Atomic (nars.term.atom.Atomic)2 Variable (nars.term.var.Variable)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (org.jetbrains.annotations.Nullable)2 alice.tuprolog (alice.tuprolog)1 FileNotFoundException (java.io.FileNotFoundException)1 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Prioritized (jcog.pri.Prioritized)1 Narsese (nars.Narsese)1