Search in sources :

Example 1 with EllipsisOneOrMore

use of nars.derive.match.EllipsisOneOrMore in project narchy by automenta.

the class EllipsisTest method testEllipsisInMinArity.

@Test
public void testEllipsisInMinArity() {
    Atomic a = Atomic.the("a");
    Ellipsis b = new EllipsisOneOrMore($.varPattern(1));
    for (Op o : Op.values()) {
        if (o.minSize <= 1)
            continue;
        if (o.statement)
            continue;
        if (o != DIFFe && o != DIFFi) {
            assertEquals(a, o.the(DTERNAL, a), o + " with normal term");
        } else {
            assertEquals(Null, o.the(DTERNAL, a));
        }
        assertEquals(o.statement ? VAR_PATTERN : o, o.the(DTERNAL, b).op(), o + " with ellipsis not reduced");
    }
}
Also used : Op(nars.Op) Ellipsis(nars.derive.match.Ellipsis) Ellipsis.firstEllipsis(nars.derive.match.Ellipsis.firstEllipsis) EllipsisOneOrMore(nars.derive.match.EllipsisOneOrMore) Atomic(nars.term.atom.Atomic) Test(org.junit.jupiter.api.Test)

Aggregations

Op (nars.Op)1 Ellipsis (nars.derive.match.Ellipsis)1 Ellipsis.firstEllipsis (nars.derive.match.Ellipsis.firstEllipsis)1 EllipsisOneOrMore (nars.derive.match.EllipsisOneOrMore)1 Atomic (nars.term.atom.Atomic)1 Test (org.junit.jupiter.api.Test)1