use of nars.test.TestNAR in project narchy by automenta.
the class NAL6Test method variable_elimination_sim_pred.
@Test
public void variable_elimination_sim_pred() {
TestNAR tester = test;
tester.believe("((bird --> $x) <-> (swimmer --> $x))");
tester.believe("(bird --> swan)", 0.90f, 0.9f);
tester.mustBelieve(cycles, "(swimmer --> swan)", 0.90f, 0.81f);
// 0.43f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL6Test method variable_unification4.
@Test
public void variable_unification4() {
TestNAR tester = test;
// en("What can be said about bird can also be said about robin.");
tester.believe("<<bird --> $x> ==> <robin --> $x>>");
// en("What can be said about swimmer usually can also be said about robin.");
tester.believe("<<swimmer --> $y> ==> <robin --> $y>>", 0.70f, 0.90f);
// en("What can be said about bird and swimmer can also be said about robin.");
tester.mustBelieve(cycles, "<(&&,<bird --> $1>,<swimmer --> $1>) ==> <robin --> $1>>", 0.7f, /*1f? */
0.81f);
// tester.mustBelieve(cycles, "<(||,<bird --> $1>,<swimmer --> $1>) ==> <robin --> $1>>", 0.70f, 0.81f); //en("What can be said about bird or swimmer can also be said about robin.");
// en("I guess what can be said about bird can also be said about swimmer.");
tester.mustBelieve(cycles, "<<bird --> $1> ==> <swimmer --> $1>>", 1f, 0.36F);
// en("I guess what can be said about swimmer can also be said about bird.");
tester.mustBelieve(cycles, "<<swimmer --> $1> ==> <bird --> $1>>", 0.7f, 0.45f);
// tester.mustBelieve(cycles, "<<bird --> $1> <=> <swimmer --> $1>>", 0.7f, 0.45f); //en("I guess bird and swimmer share most properties.");
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL6Test method second_level_variable_unification_neg.
@Test
public void second_level_variable_unification_neg() {
TestNAR tester = test;
tester.believe("(((#1 --> lock) && --($2 --> key)) ==> open($2, #1))");
tester.believe("--({key1} --> key)");
tester.mustBelieve(cycles, "((#1 --> lock) && open({key1}, #1))", 1.00f, 0.81f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL6Test method strong_elimination.
// see discussion on https://groups.google.com/forum/#!topic/open-nars/1TmvmQx2hMk
@Test
public void strong_elimination() {
TestNAR tester = test;
tester.believe("((test($a,is,cat) && sentence($a,is,$b)) ==> ($a --> $b))");
tester.believe("test(tim,is,cat)");
tester.mustBelieve(cycles, "(sentence(tim,is,$1) ==> (tim --> $1))", 1.00f, // en("there is a lock which is opened by key1");
0.73f);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL6Test method variable_unification6.
@Test
public void variable_unification6() {
TestNAR tester = test;
// en("If something can fly, chirp, and eats worms, then it is a bird.");
tester.believe("<(&&,<$x --> flyer>,<$x --> [chirping]>, <($x, worms) --> food>) ==> <$x --> bird>>");
// en("If something can chirp and has wings, then it is a bird.");
tester.believe("<(&&,<$y --> [chirping]>,<$y --> [withWings]>) ==> <$y --> bird>>");
tester.mustBelieve(cycles, "<(&&,<$1 --> flyer>,<($1,worms) --> food>) ==> <$1 --> [withWings]>>", 1.00f, 0.45f);
tester.mustBelieve(cycles, "<<$1 --> [withWings]> ==> (&&,<$1 --> flyer>,<($1,worms) --> food>)>", 1.00f, 0.45f);
/*
<patham9>
first result:
(&&,<$1 --> flyer>,<($1,worms) --> food>) ==> <$1 --> [withWings]>>
it comes from the rule
((&&,C,A_1..n) ==> Z), ((&&,C,B_1..m) ==> Z) |- ((&&,A_1..n) ==> (&&,B_1..m)), (Truth:Induction)
which basically says: if two different precondition conjunctions, with a common element lead to the same conclusion,
it might be that these different preconditions in the specific conjunctions imply each other
(each other because the premises can be swapped for this rule and it is still valid)
second result:
<<$1 --> [withWings]> ==> (&&,<$1 --> flyer>,<($1,worms) --> food>)>
by the same rule:
((&&,C,A_1..n) ==> Z), ((&&,C,B_1..m) ==> Z) |- ((&&,B_1..m) ==> (&&,A_1..n)), (Truth:Induction)
where this time the diffierent preconditions of the second conjunction imply the different preconditions of the first
no, no additionally info needed
now I will show you what I think went wrong in your system:
you got:
((&&,(($1,worms)-->food),($1-->flyer),($1-->[chirping]))==>(($1-->[withWings])&&($1-->[chirping]))).
abduction in progress ^^
your result is coming from the induction rule
(P ==> M), (S ==> M), not_equal(S,P) |- (S ==> P), (Truth:Induction, Derive:AllowBackward)
there are two possibilities, either restrict not_equal further to no_common_subter,
or make the constructor of ==> make sure that the elements which occur in predicate and subject as well are removed
its less fatal than in the inheritance composition, the derivation isnt wrong fundamentally, but if you can do so efficiently, let it avoid it
additionally make sure that the two
((&&,C,A_1..n) ==> Z), ((&&,C,B_1..m) ==> Z) |- ((&&,A_1..n) ==> (&&,B_1..m)), (Truth:Induction)
rules work, they are demanded by this reasoning about preconditions
*hypothetical reasoning about preconditions to be exact
*/
}
Aggregations