use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method conditional_induction0NegBoth.
@Test
public void conditional_induction0NegBoth() {
TestNAR tester = test;
tester.believe("--((&&,x1,x2,a) ==> c)");
tester.believe("--((&&,y1,y2,a) ==> c)");
tester.mustBelieve(cycles, "((x1&&x2) ==> (y1&&y2))", 1.00f, 0.45f);
tester.mustBelieve(cycles, "((y1&&y2) ==> (x1&&x2))", 1.00f, 0.45f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method deduction.
@Test
public void deduction() {
TestNAR tester = test;
// .en("If robin is a type of bird then robin is a type of animal.");
tester.believe("<<robin --> bird> ==> <robin --> animal>>");
// .en("If robin can fly then robin is a type of bird.");
tester.believe("<<robin --> [flying]> ==> <robin --> bird>>");
// .en("If robin can fly then robin is a type of animal.");
tester.mustBelieve(cycles, "<<robin --> [flying]> ==> <robin --> animal>>", 1.00f, 0.81f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method conditional_deduction3.
@Test
public void conditional_deduction3() {
TestNAR tester = test;
// .en("If robin is a bird and it's living, then robin is an animal");
tester.believe("<(&&,<robin --> bird>,<robin --> [living]>) ==> <robin --> animal>>");
// .en("If robin can fly, then robin is a bird");
tester.believe("<<robin --> [flying]> ==> <robin --> bird>>");
// .en("If robin is living and it can fly, then robin is an animal.");
tester.mustBelieve(cycles * 2, " <(&&,<robin --> [flying]>,<robin --> [living]>) ==> <robin --> animal>>", 1.00f, 0.81f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method compound_decomposition_one_premise_neg.
@Test
public void compound_decomposition_one_premise_neg() {
// freq 0 conjunction would not be decomposed
TestNAR tester = test;
// .en("Robin cannot be both a flyer and a swimmer.");
tester.believe("(&&,<robin --> [flying]>,<robin --> swimmer>)", 0.0f, 0.9f);
// .en("Robin cannot swim.");
tester.mustNotOutput(cycles, "<robin --> swimmer>", BELIEF, ETERNAL);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL5Test method contraposition1.
// @Disabled
// @Test
// public void negation2() throws nars.Narsese.NarseseException {
//
// TestNAR tester = test;
// tester.believe("<robin --> [flying]>", 0.9f, 0.9f); //.en("Robin can fly.");
// tester.ask("(--,<robin --> [flying]>)"); //.en("Can robin fly or not?");
// tester.mustBelieve(cycles, "(--,<robin --> [flying]>)", 0.10f, 0.90f); //.en("It is unlikely that robin cannot fly.");
//
// }
@Test
public void contraposition1() throws nars.Narsese.NarseseException {
TestNAR tester = test;
/*
IN: <(--,<robin --> bird>) ==> <robin --> [flying]>>. %0.1%
// It is unlikely that if robin is not a type of bird then robin can fly.
IN: <(--,<robin --> [flying]>) ==> <robin --> bird>>?
// If robin cannot fly then is robin a type of bird?
OUT: <(--,<robin --> [flying]>) ==> <robin --> bird>>. %0.00;0.45%
// I guess it is unlikely that if robin cannot fly then robin is a type of bird.
*/
// .en("It is unlikely that if robin is not a type of bird then robin can fly.");
tester.believe("<(--,<robin --> bird>) ==> <robin --> [flying]>>", 0.1f, 0.9f);
// .en("If robin cannot fly then is robin a type of bird ? ");
tester.ask("<(--,<robin --> [flying]>) ==> <robin --> bird>>");
// .en("I guess it is unlikely that if robin cannot fly then robin is a type of bird.");
tester.mustBelieve(cycles, " <(--,<robin --> [flying]>) ==> <robin --> bird>>", 0f, 0.45f);
}
Aggregations