Search in sources :

Example 11 with Conj

use of nars.term.compound.util.Conj in project narchy by automenta.

the class ConjTest method testSimpleEternals.

@Test
public void testSimpleEternals() {
    Conj c = new Conj();
    c.add($.the("x"), ETERNAL);
    c.add($.the("y"), ETERNAL);
    assertEquals("(x&&y)", c.term().toString());
    assertEquals(1, c.event.size());
    assertEquals(byte[].class, c.event.get(ETERNAL).getClass());
}
Also used : Conj(nars.term.compound.util.Conj) Test(org.junit.jupiter.api.Test)

Example 12 with Conj

use of nars.term.compound.util.Conj in project narchy by automenta.

the class ConjTest method testRoaringBitmapNeededManyEventsAtSameTime.

@Test
public void testRoaringBitmapNeededManyEventsAtSameTime() {
    Conj c = new Conj();
    c.add($.the("a"), 1);
    c.add($.the("b"), 1);
    c.add($.the("c"), 1);
    c.add($.the("d"), 1);
    c.add($.the("e"), 1);
    assertEquals("(&|,a,b,c,d,e)", c.term().toString());
    assertEquals(1, c.event.size());
    assertEquals(RoaringBitmap.class, c.event.get(1).getClass());
}
Also used : Conj(nars.term.compound.util.Conj) Test(org.junit.jupiter.api.Test)

Example 13 with Conj

use of nars.term.compound.util.Conj in project narchy by automenta.

the class ConjTest method testEventContradictionWithEternal.

@Test
public void testEventContradictionWithEternal() {
    Conj c = new Conj();
    c.add($.the("x"), ETERNAL);
    c.add($.the("x").neg(), 1);
    assertEquals(False, c.term());
}
Also used : Conj(nars.term.compound.util.Conj) Test(org.junit.jupiter.api.Test)

Aggregations

Conj (nars.term.compound.util.Conj)13 Test (org.junit.jupiter.api.Test)10 Op (nars.Op)2 Subterms (nars.subterm.Subterms)2 Term (nars.term.Term)2 java.io (java.io)1 java.util (java.util)1 Predicate (java.util.function.Predicate)1 ScriptException (javax.script.ScriptException)1 TODO (jcog.TODO)1 Texts (jcog.Texts)1 User (jcog.User)1 FasterList (jcog.list.FasterList)1 PriReference (jcog.pri.PriReference)1 Concept (nars.concept.Concept)1 Operator (nars.concept.Operator)1 DepIndepVarIntroduction (nars.op.DepIndepVarIntroduction)1 ListFunc (nars.op.ListFunc)1 MathFunc (nars.op.MathFunc)1 Subst (nars.op.Subst)1