use of nars.term.var.Variable in project narchy by automenta.
the class CommonVariableTest method commonVariableTest1.
@Test
public void commonVariableTest1() {
// same forward and reverse
Variable p1p2 = CommonVariable.common(p1, p2);
assertEquals("#1_2", p1p2.toString());
Variable p2p1 = CommonVariable.common(p2, p1);
assertEquals("#1_2", p2p1.toString());
}
use of nars.term.var.Variable in project narchy by automenta.
the class CommonVariableTest method CommonVariableOfCommonVariable.
@Test
public void CommonVariableOfCommonVariable() {
Variable c123 = CommonVariable.common(c12, p3);
assertEquals("#1_2_3 class nars.term.var.CommonVariable", (c123 + " " + c123.getClass()));
// duplicate: already included
assertSame(c123, CommonVariable.common(c123, p2));
assertEquals(c123, CommonVariable.common(c123, p1));
}
Aggregations