However, that example should be changed to load all modules that it needs, instead of leaving the user to guess what needs to be done. Its not a very user-friendly example.
Perhaps you could try to do this? Ideally, one should be able to just run "guile -l someexample.scm" and have it just work, with no (or minimal) junk in the ~/.guile file --linas On Fri, Feb 10, 2017 at 7:18 AM, Vishnu Priya <vishnupriya...@gmail.com> wrote: > > Hi Nil, > Thanks. > I also got an exception when i typed the following line in scheme as in > > https://github.com/opencog/atomspace/tree/master/examples/rule-engine/chaining > > guile> (DefineLink rule1-name rule1) > > Backtrace: > In ice-9/boot-9.scm: > 157: 10 [catch #t #<catch-closure 211c720> ...] > In unknown file: > ?: 9 [apply-smob/1 #<catch-closure 211c720>] > In ice-9/boot-9.scm: > 157: 8 [catch #t #<catch-closure 2123cc0> ...] > In unknown file: > ?: 7 [apply-smob/1 #<catch-closure 2123cc0>] > ?: 6 [call-with-input-string "(DefineLink rule1-name rule1)\n" ...] > In ice-9/boot-9.scm: > 2320: 5 [save-module-excursion #<procedure 20c07e0 at > ice-9/eval-string.scm:65:9 ()>] > In ice-9/eval-string.scm: > 44: 4 [read-and-eval #<input: string 28fba90> #:lang ...] > 37: 3 [lp (DefineLink rule1-name rule1)] > In unknown file: > ?: 2 [cog-new-link 44 (Node "rule1") > ...] > In ice-9/boot-9.scm: > 102: 1 [#<procedure 211fd40 at ice-9/boot-9.scm:97:6 (thrown-k . args)> > C++-EXCEPTION ...] > In unknown file: > ?: 0 [apply-smob/1 #<catch-closure 2123c80> C++-EXCEPTION ...] > > ERROR: In procedure apply-smob/1: > ERROR: In procedure cog-new-link: Expecting > Defined(Schema/Predicate/Type)Node, got Node > (/opt/atomspace/opencog/atoms/core/DefineLink.cc:47) > ABORT: C++-EXCEPTION. > > > So when i ran fc, it showed "ERROR: In procedure cog-fc: Cannot find > defined hypergraph for atom (Node "rule1") ; [35727][1]" > > > > > > > > > > > > On Friday, 10 February 2017 11:53:38 UTC+1, Nil wrote: >> >> Hi, it looks like you didn't import the rule-engine modules, see for >> instance >> >> >> https://github.com/opencog/atomspace/blob/master/examples/rule-engine/crisp.scm#L16 >> >> Nil >> >> On 02/10/2017 12:26 PM, Vishnu Priya wrote: >> > Hi, >> > >> > I tried forward chaining as in >> > >> > https://github.com/opencog/atomspace/tree/master/examples/rule-engine/chaining >> > for the following problem: >> > >> > |1. If X croaks and X eats flies - Then X is a frog 2. If X is a frog - >> > Then X is green| >> > >> > >> > When i ran forward chainer by (cog-fc source wiki (SetLink)), i got >> > unbound variable error. >> > >> > guile> (cog-fc source wiki (SetLink)) >> > Backtrace: >> > In ice-9/boot-9.scm: >> > 157: 12 [catch #t #<catch-closure 229ac80> ...] >> > In unknown file: >> > ?: 11 [apply-smob/1 #<catch-closure 229ac80>] >> > In ice-9/boot-9.scm: >> > 157: 10 [catch #t #<catch-closure 229a7e0> ...] >> > In unknown file: >> > ?: 9 [apply-smob/1 #<catch-closure 229a7e0>] >> > ?: 8 [call-with-input-string "(cog-fc source wiki (SetLink))\n" ...] >> > In ice-9/boot-9.scm: >> > 2320: 7 [save-module-excursion #<procedure 1e18bd0 at >> > ice-9/eval-string.scm:65:9 ()>] >> > In ice-9/eval-string.scm: >> > 44: 6 [read-and-eval #<input: string 20ce340> #:lang ...] >> > 37: 5 [lp (cog-fc source wiki (SetLink))] >> > In ice-9/eval.scm: >> > 386: 4 [eval #<memoized (cog-fc source wiki (SetLink))> ()] >> > 393: 3 [eval #<memoized cog-fc> ()] >> > In unknown file: >> > ?: 2 [memoize-variable-access! #<memoized cog-fc> #<directory # >> > 13a2c60>] >> > In ice-9/boot-9.scm: >> > 102: 1 [#<procedure 18a4d40 at ice-9/boot-9.scm:97:6 (thrown-k . args)> >> > unbound-variable ...] >> > In unknown file: >> > ?: 0 [apply-smob/1 #<catch-closure 229a7a0> unbound-variable ...] >> > >> > ERROR: In procedure apply-smob/1: >> > ERROR: Unbound variable: cog-fc >> > ABORT: unbound-variable >> > >> > I have these lines in .guile: >> > (add-to-load-path "/usr/local/share/opencog/scm") >> > (use-modules (opencog)) >> > (use-modules (opencog query)) >> > (use-modules (opencog exec)) >> > (load-from-path "opencog.scm") >> > >> > >> > How can i get it working? >> > >> > >> > Thanks >> > Vishnu >> > >> > >> > >> > >> > >> > >> > On Monday, 5 December 2016 17:01:54 UTC+1, Nil wrote: >> > >> > Hi, >> > >> > the backward chainer is not mature yet, it may or not work for you, >> > I >> > think it will be mature enough after 2 week. >> > >> > The forward chainer should work as expected. See >> > http://wiki.opencog.org/w/URE_Configuration_Format >> > <http://wiki.opencog.org/w/URE_Configuration_Format> to define a >> > rule base. >> > >> > See also >> > >> > https://github.com/opencog/atomspace/tree/master//examples/rule-engine >> > >> > <https://github.com/opencog/atomspace/tree/master//examples/rule-engine> >> > >> > as well https://github.com/opencog/opencog/tree/master/examples/pln >> > <https://github.com/opencog/opencog/tree/master/examples/pln> for >> > examples. >> > >> > Nil >> > >> > On 12/05/2016 05:18 PM, Vishnu Priya wrote: >> > > Hello all, >> > > >> > > i would like to try the forward/backward chaining. i found these >> > pages >> > > >> > >> > https://github.com/opencog/atomspace/tree/master//opencog/rule-engine#how-to-call-the-forward-chainer-from-a-scheme-interface >> > >> > <https://github.com/opencog/atomspace/tree/master//opencog/rule-engine#how-to-call-the-forward-chainer-from-a-scheme-interface> >> > >> > > http://wiki.opencog.org/w/Unified_rule_engine >> > <http://wiki.opencog.org/w/Unified_rule_engine> >> > > >> > > I somehow understood, how overall process goes on. >> > > >> > > (cog-fc *source* *rule-base* *focus-set*) >> > > But i don't know, how I can carry out this process. i also don't >> > know, >> > > how to specify rule-base, focus-set.. >> > > Can you anyone provide the steps to carry out chaining process ? >> > > >> > > Thanks, >> > > Vishnu >> > > >> > > -- >> > > You received this message because you are subscribed to the Google >> > > Groups "opencog" group. >> > > To unsubscribe from this group and stop receiving emails from it, >> > send >> > > an email to opencog+u...@googlegroups.com <javascript:> >> > > <mailto:opencog+u...@googlegroups.com <javascript:>>. >> > > To post to this group, send email to ope...@googlegroups.com >> > <javascript:> >> > > <mailto:ope...@googlegroups.com <javascript:>>. >> > > Visit this group at https://groups.google.com/group/opencog >> > <https://groups.google.com/group/opencog>. >> > > To view this discussion on the web visit >> > > >> > >> > https://groups.google.com/d/msgid/opencog/b0170017-7cd2-415a-9d64-7ed9f154ae35%40googlegroups.com >> > >> > <https://groups.google.com/d/msgid/opencog/b0170017-7cd2-415a-9d64-7ed9f154ae35%40googlegroups.com> >> > >> > > >> > >> > <https://groups.google.com/d/msgid/opencog/b0170017-7cd2-415a-9d64-7ed9f154ae35%40googlegroups.com?utm_medium=email&utm_source=footer >> > >> > <https://groups.google.com/d/msgid/opencog/b0170017-7cd2-415a-9d64-7ed9f154ae35%40googlegroups.com?utm_medium=email&utm_source=footer>>. >> > >> > > For more options, visit https://groups.google.com/d/optout >> > <https://groups.google.com/d/optout>. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "opencog" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an email to opencog+u...@googlegroups.com >> > <mailto:opencog+u...@googlegroups.com>. >> > To post to this group, send email to ope...@googlegroups.com >> > <mailto:ope...@googlegroups.com>. >> > Visit this group at https://groups.google.com/group/opencog. >> > To view this discussion on the web visit >> > >> > https://groups.google.com/d/msgid/opencog/68bd5322-8dec-4983-abd7-0f2e1072606b%40googlegroups.com >> > >> > <https://groups.google.com/d/msgid/opencog/68bd5322-8dec-4983-abd7-0f2e1072606b%40googlegroups.com?utm_medium=email&utm_source=footer>. >> > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "opencog" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to opencog+unsubscr...@googlegroups.com. > To post to this group, send email to opencog@googlegroups.com. > Visit this group at https://groups.google.com/group/opencog. > To view this discussion on the web visit > https://groups.google.com/d/msgid/opencog/c9b144df-0031-4dd5-b9b7-608a5381c3a7%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "opencog" group. To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscr...@googlegroups.com. To post to this group, send email to opencog@googlegroups.com. Visit this group at https://groups.google.com/group/opencog. To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/CAHrUA34kM-05bqqEtjYftZa2x6S5g%2B%3D2h42pjDECybaFwAQFMA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.