opennars / Narjure

A Clojure implementation of the Non-Axiomatic Reasoning System proposed by Pei Wang.
GNU General Public License v2.0
43 stars 11 forks source link

Broken tests in nal.test.deriver and narjure.test.narsese #58

Open jorisbontje opened 8 years ago

jorisbontje commented 8 years ago

https://circleci.com/gh/opennars/opennars2/615

lein trampoline test
Retrieving com/google/protobuf/protobuf-java/2.6.1/protobuf-java-2.6.1.jar from central
12:15:03.613 [main] INFO  c.p.actors.ActorRegistry - Actor registry is co.paralleluniverse.actors.LocalActorRegistry@55236822
Beliefs rules: 3151
Questions rules: 474
Goal rules: 3161
Quests rules: 474
"Elapsed time: 23898.244313 msecs"

lein test nal.test.deriver

lein test :only nal.test.deriver/variable_unification6

ERROR in (variable_unification6) (unify.clj:95)
expected: (derived "<(&&,<$1 --> flyer>,<$1 --> [chirping]>, <($1, worms) --> food>) ==> <$1 --> bird>>." "<(&&,<$1 --> [chirping]>,<$1 --> [withWings]>) ==> <$1 --> bird>>." ["<(&&,<$1 --> flyer>,<($1, worms) --> food>) ==> <$1 --> [withWings]>>. %1.00;0.45%" "<<$1 --> [withWings]> ==> (&&,<$1 --> flyer>,<($1, worms) --> food>)>. %1.00;0.45%"])
  actual: java.lang.IllegalStateException: Cycle found in the path [* [ind-var 1] worms]
 at clojure.core.unify$var_unify__5706.invokeStatic (unify.clj:95)
    clojure.core.unify/var_unify (unify.clj:95)
    clojure.core.unify$garner_unifiers.invokeStatic (unify.clj:118)
    clojure.core.unify$garner_unifiers.invoke (unify.clj:105)
    clojure.core.unify$garner_unifiers.invokeStatic (unify.clj:125)
    clojure.core.unify$garner_unifiers.invoke (unify.clj:105)
    clojure.core.unify$garner_unifiers.invokeStatic (unify.clj:121)
    clojure.core.unify$garner_unifiers.invoke (unify.clj:105)
    clojure.core.unify$garner_unifiers.invokeStatic (unify.clj:125)
    clojure.core.unify$garner_unifiers.invoke (unify.clj:105)
    clojure.core.unify$garner_unifiers.invokeStatic (unify.clj:121)
    clojure.core.unify$garner_unifiers.invoke (unify.clj:105)
    clojure.core.unify$garner_unifiers.invokeStatic (unify.clj:121)
    clojure.core.unify$garner_unifiers.invoke (unify.clj:105)
    clojure.core.unify$make_occurs_unify_fn$fn__5739.invoke (unify.clj:173)
    nal.deriver.substitution$unification_map.invokeStatic (substitution.clj:19)
    nal.deriver.substitution$unification_map.invoke (substitution.clj:13)
    nal.rules$eval13267$fn__13270.invoke (rules.clj:692)
    nal.deriver$get_matcher$fn__93646$fn__93647.invoke (deriver.clj:19)
    clojure.core$map$fn__4785.invoke (core.clj:2646)
    clojure.lang.LazySeq.sval (LazySeq.java:40)
    clojure.lang.LazySeq.seq (LazySeq.java:49)
    clojure.lang.RT.seq (RT.java:521)
    clojure.core$seq__4357.invokeStatic (core.clj:137)
    clojure.core$apply.invokeStatic (core.clj:641)
    clojure.core$mapcat.invokeStatic (core.clj:2674)
    clojure.core$mapcat.doInvoke (core.clj:2674)
    clojure.lang.RestFn.invoke (RestFn.java:423)
    nal.deriver$get_matcher$fn__93646.invoke (deriver.clj:19)
    nal.deriver$generate_conclusions_no_commutativity.invokeStatic (deriver.clj:30)
    nal.deriver$generate_conclusions_no_commutativity.invoke (deriver.clj:26)
    nal.deriver$generate_conclusions$iter__93688__93692$fn__93693$fn__93694.invoke (deriver.clj:72)
    nal.deriver$generate_conclusions$iter__93688__93692$fn__93693.invoke (deriver.clj:71)
    clojure.lang.LazySeq.sval (LazySeq.java:40)
    clojure.lang.LazySeq.seq (LazySeq.java:49)
    clojure.lang.RT.seq (RT.java:521)
    clojure.core$seq__4357.invokeStatic (core.clj:137)
    clojure.core$apply.invokeStatic (core.clj:641)
    clojure.core$apply.invoke (core.clj:641)
    nal.deriver$generate_conclusions.invokeStatic (deriver.clj:71)
    nal.deriver$generate_conclusions.invoke (deriver.clj:68)
    nal.deriver$reorder_inference.invokeStatic (deriver.clj:95)
    nal.deriver$reorder_inference.invoke (deriver.clj:89)
    nal.deriver$inference.invokeStatic (deriver.clj:115)
    nal.deriver$inference.invoke (deriver.clj:102)
    nal.test_utils$conclusions.invokeStatic (test_utils.clj:23)
    nal.test_utils$conclusions.invoke (test_utils.clj:18)
    nal.test_utils$derived$fn__95067$fn__95068.invoke (test_utils.clj:37)
    clojure.core$every_QMARK_.invokeStatic (core.clj:2572)
    clojure.core$every_QMARK_.invoke (core.clj:2563)
    nal.test_utils$derived$fn__95067.invoke (test_utils.clj:31)
    clojure.lang.AFn.call (AFn.java:18)
    clojure.lang.LockingTransaction.run (LockingTransaction.java:273)
    clojure.lang.LockingTransaction.runInTransaction (LockingTransaction.java:229)
    nal.test_utils$derived.invokeStatic (test_utils.clj:28)
    nal.test_utils$derived.invoke (test_utils.clj:25)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.AFn.applyTo (AFn.java:144)
    clojure.core$apply.invokeStatic (core.clj:646)
    clojure.core$apply.invoke (core.clj:641)
    nal.test.deriver$fn__95552.invokeStatic (deriver.clj:551)
    nal.test.deriver/fn (deriver.clj:550)
    clojure.test$test_var$fn__7983.invoke (test.clj:716)
    clojure.test$test_var.invokeStatic (test.clj:716)
    clojure.test$test_var.invoke (test.clj:707)
    clojure.test$test_vars$fn__8005$fn__8010.invoke (test.clj:734)
    clojure.test$default_fixture.invokeStatic (test.clj:686)
    clojure.test$default_fixture.invoke (test.clj:682)
    clojure.test$test_vars$fn__8005.invoke (test.clj:734)
    clojure.test$default_fixture.invokeStatic (test.clj:686)
    clojure.test$default_fixture.invoke (test.clj:682)
    clojure.test$test_vars.invokeStatic (test.clj:730)
    clojure.test$test_all_vars.invokeStatic (test.clj:736)
    clojure.test$test_ns.invokeStatic (test.clj:757)
    clojure.test$test_ns.invoke (test.clj:742)
    clojure.core$map$fn__4785.invoke (core.clj:2646)
    clojure.lang.LazySeq.sval (LazySeq.java:40)
    clojure.lang.LazySeq.seq (LazySeq.java:49)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.boundedLength (RT.java:1749)
    clojure.lang.RestFn.applyTo (RestFn.java:130)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.test$run_tests.invokeStatic (test.clj:767)
    clojure.test$run_tests.doInvoke (test.clj:767)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:646)
    clojure.core$apply.invoke (core.clj:641)
    user$eval85$fn__144$fn__175.invoke (form-init3172037995660785312.clj:1)
    user$eval85$fn__144$fn__145.invoke (form-init3172037995660785312.clj:1)
    user$eval85$fn__144.invoke (form-init3172037995660785312.clj:1)
    user$eval85.invokeStatic (form-init3172037995660785312.clj:1)
    user$eval85.invoke (form-init3172037995660785312.clj:1)
    clojure.lang.Compiler.eval (Compiler.java:6927)
    clojure.lang.Compiler.eval (Compiler.java:6917)
    clojure.lang.Compiler.load (Compiler.java:7379)
    clojure.lang.Compiler.loadFile (Compiler.java:7317)
    clojure.main$load_script.invokeStatic (main.clj:275)
    clojure.main$init_opt.invokeStatic (main.clj:277)
    clojure.main$init_opt.invoke (main.clj:277)
    clojure.main$initialize.invokeStatic (main.clj:308)
    clojure.main$null_opt.invokeStatic (main.clj:342)
    clojure.main$null_opt.invoke (main.clj:339)
    clojure.main$main.invokeStatic (main.clj:421)
    clojure.main$main.doInvoke (main.clj:384)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:383)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)

lein test :only nal.test.deriver/second_level_variable_unification2

FAIL in (second_level_variable_unification2) (deriver.clj:656)
expected: (derived "<{key1} --> key>. %1.00;0.90%" "<<$X --> lock> ==> (&&,<#Y --> key>,<$X --> (/,open,#Y,_)>)>. %1.00;0.90%" ["<<$X --> lock> ==> <$X --> (/,open,{key1},_)>>. %1.00;0.42%"])
  actual: (not (derived "<{key1} --> key>. %1.00;0.90%" "<<$X --> lock> ==> (&&,<#Y --> key>,<$X --> (/,open,#Y,_)>)>. %1.00;0.90%" ["<<$X --> lock> ==> <$X --> (/,open,{key1},_)>>. %1.00;0.42%"]))

lein test :only nal.test.deriver/second_level_variable_unification

FAIL in (second_level_variable_unification) (deriver.clj:649)
expected: (derived "<{key1} --> key>. %1.00;0.90%" "(&&,<#1 --> lock>,<<$2 --> key> ==> <#1 --> (/,open,$2,_)>>). %1.00;0.90%" ["(&&,<#1 --> lock>,<#1 --> (/,open,{key1},_)>). %1.00;0.81%"])
  actual: (not (derived "<{key1} --> key>. %1.00;0.90%" "(&&,<#1 --> lock>,<<$2 --> key> ==> <#1 --> (/,open,$2,_)>>). %1.00;0.90%" ["(&&,<#1 --> lock>,<#1 --> (/,open,{key1},_)>). %1.00;0.81%"]))

lein test :only nal.test.deriver/negation

FAIL in (negation) (deriver.clj:444)
expected: (derived "(--,<robin --> [flying]>). %0.1;0.9%" "<robin --> [flying]>?" ["<robin --> [flying]>. %0.90;0.90%"])
  actual: (not (derived "(--,<robin --> [flying]>). %0.1;0.9%" "<robin --> [flying]>?" ["<robin --> [flying]>. %0.90;0.90%"]))

lein test nal.test.deriver.backward-rules

lein test nal.test.deriver.key-path

lein test nal.test.deriver.list-expansion

lein test nal.test.deriver.matching

lein test nal.test.deriver.normalization

lein test nal.test.deriver.preconditions

lein test nal.test.deriver.premises-swapping

lein test nal.test.deriver.rules

lein test nal.test.deriver.substitution

lein test nal.test.deriver.terms-premutation

lein test nal.test.deriver.truth

lein test :only nal.test.deriver.truth/test-structual-abduction

FAIL in (test-structual-abduction) (truth.clj:173)
expected: (clojure.core/= [0.7 0.15254237288135597] (structual-abduction [0.7 0.2] [1 0.9]))
  actual: (not (clojure.core/= [0.7 0.15254237288135597] [1 0.44751381215469616]))

lein test :only nal.test.deriver.truth/test-structual-abduction

FAIL in (test-structual-abduction) (truth.clj:173)
expected: (clojure.core/= [1 0.44751381215469616] (structual-abduction [1 0.9] [0.7 0.2]))
  actual: (not (clojure.core/= [1 0.44751381215469616] [0.7 0.15254237288135597]))

lein test :only nal.test.deriver.truth/test-belief-identity

FAIL in (test-belief-identity) (truth.clj:191)
expected: (clojure.core/= [1 0.6] (belief-identity [1 0.6] [1 0.7]))
  actual: (not (clojure.core/= [1 0.6] [1 0.7]))

lein test :only nal.test.deriver.truth/test-belief-identity

FAIL in (test-belief-identity) (truth.clj:191)
expected: (clojure.core/= [0.3 0.6] (belief-identity [0.3 0.6] [0.1 0.8]))
  actual: (not (clojure.core/= [0.3 0.6] [0.1 0.8]))

lein test nal.test.reader

lein test nal.test.test-utils

lein test narjure.test.bag

lein test narjure.test.narsese

lein test :only narjure.test.narsese/test-parser

FAIL in (test-parser) (narsese.clj:24)
expected: (= (quote [retrospective-implication [--> [* [ind-var x] room_101] enter] [--> [* [ind-var x] door_101] open]]) (narsese->clj "<<( $x, room_101) --> enter> =\\> <( $x, door_101) --> open>>. %0.9;0.1%"))
  actual: (not (= [retrospective-implication [--> [* [ind-var x] room_101] enter] [--> [* [ind-var x] door_101] open]] [retro-impl [--> [* [ind-var x] room_101] enter] [--> [* [ind-var x] door_101] open]]))

Ran 210 tests containing 427 assertions.
8 failures, 1 errors.

lein trampoline test returned exit code 9
patham9 commented 8 years ago

Some of the failing ones test for a wrong value, second layer var-unification is not supported, and negation is a forward rule now this is why the backward-driven-forward-rule test fails here. All these are just minor issues, but we will carefully resolve them all after AGI-16. The ones that test for wrong value will be resolved earlier, directly after I'm finished with the NLP examples as having testcases which test for a wrong result is not good. :)