opencog / opencog

A framework for integrated Artificial Intelligence & Artificial General Intelligence (AGI)
http://wiki.opencog.org/w/Development
Other
2.34k stars 724 forks source link

ERROR: Unbound variable: cog-execute! #1739

Closed amebel closed 9 years ago

amebel commented 9 years ago

Steps taken

guile>
(define a (PutLink
    (SatisfyingSetLink
        (EvaluationLink
            (PredicateNode "eat")
            (ListLink
                (ConceptNode "spiders")
                (VariableNode "x"))))
    (VariableNode "x")))

guile> 
(EvaluationLink
        (PredicateNode "eat")
        (ListLink
            (ConceptNode "spiders")
             (ConceptNode "humans")))

guile> (cog-execute! a)
Backtrace:
In ice-9/boot-9.scm:
 157: 12 [catch #t #<catch-closure 2a7ecc0> ...]
In unknown file:
   ?: 11 [apply-smob/1 #<catch-closure 2a7ecc0>]
In ice-9/boot-9.scm:
 157: 10 [catch #t #<catch-closure 2a7e880> ...]
In unknown file:
   ?: 9 [apply-smob/1 #<catch-closure 2a7e880>]
   ?: 8 [call-with-input-string "(cog-execute! a)\n" ...]
In ice-9/boot-9.scm:
2320: 7 [save-module-excursion #<procedure 28636f0 at ice-9/eval-string.scm:65:9 ()>]
In ice-9/eval-string.scm:
  44: 6 [read-and-eval #<input: string 281e270> #:lang ...]
  37: 5 [lp (cog-execute! a)]
In ice-9/eval.scm:
 386: 4 [eval #<memoized (cog-execute! a)> ()]
 393: 3 [eval #<memoized cog-execute!> ()]
In unknown file:
   ?: 2 [memoize-variable-access! #<memoized cog-execute!> #<directory # e85c60>]
In ice-9/boot-9.scm:
 102: 1 [#<procedure 220bf40 at ice-9/boot-9.scm:97:6 (thrown-k . args)> unbound-variable ...]
In unknown file:
   ?: 0 [apply-smob/1 #<catch-closure 2a7e840> unbound-variable ...]

ERROR: In procedure apply-smob/1:
ERROR: Unbound variable: cog-execute!
ABORT: unbound-variable
guile> 

import opencog module

guile> (use-modules (opencog))

guile> (cog-execute! a)
Backtrace:
In ice-9/boot-9.scm:
 157: 12 [catch #t #<catch-closure 256cb60> ...]
In unknown file:
   ?: 11 [apply-smob/1 #<catch-closure 256cb60>]
In ice-9/boot-9.scm:
 157: 10 [catch #t #<catch-closure 256c6c0> ...]
In unknown file:
   ?: 9 [apply-smob/1 #<catch-closure 256c6c0>]
   ?: 8 [call-with-input-string "(cog-execute! a)\n" ...]
In ice-9/boot-9.scm:
2320: 7 [save-module-excursion #<procedure 2a74e70 at ice-9/eval-string.scm:65:9 ()>]
In ice-9/eval-string.scm:
  44: 6 [read-and-eval #<input: string 2849410> #:lang ...]
  37: 5 [lp (cog-execute! a)]
In ice-9/eval.scm:
 386: 4 [eval #<memoized (cog-execute! a)> ()]
 393: 3 [eval #<memoized cog-execute!> ()]
In unknown file:
   ?: 2 [memoize-variable-access! #<memoized cog-execute!> #<directory # e85c60>]
In ice-9/boot-9.scm:
 102: 1 [#<procedure 22720c0 at ice-9/boot-9.scm:97:6 (thrown-k . args)> unbound-variable ...]
In unknown file:
   ?: 0 [apply-smob/1 #<catch-closure 256c680> unbound-variable ...]

ERROR: In procedure apply-smob/1:
ERROR: Unbound variable: cog-execute!
ABORT: unbound-variable
guile> 

Try importing the (opencog exec) module

guile> (use-modules (opencog exec))
Backtrace:
In ice-9/boot-9.scm:
 157: 18 [catch #t #<catch-closure 26b54a0> ...]
In unknown file:
   ?: 17 [apply-smob/1 #<catch-closure 26b54a0>]
In ice-9/boot-9.scm:
 157: 16 [catch #t #<catch-closure 26b5020> ...]
In unknown file:
   ?: 15 [apply-smob/1 #<catch-closure 26b5020>]
   ?: 14 [call-with-input-string "(use-modules (opencog exec))\n" ...]
In ice-9/boot-9.scm:
2320: 13 [save-module-excursion #<procedure 26f73c0 at ice-9/eval-string.scm:65:9 ()>]
In ice-9/eval-string.scm:
  44: 12 [read-and-eval #<input: string 2736820> #:lang ...]
  37: 11 [lp (use-modules (opencog exec))]
In ice-9/eval.scm:
 505: 10 [#<procedure d5d620 at ice-9/eval.scm:499:4 (exp)> (use-modules #)]
In ice-9/psyntax.scm:
1091: 9 [expand-top-sequence ((use-modules (opencog exec))) () ...]
 976: 8 [scan ((use-modules (opencog exec))) () ...]
 270: 7 [scan ((# #) #(syntax-object *unspecified* # #)) () (()) ...]
In ice-9/boot-9.scm:
3513: 6 [process-use-modules (((opencog exec)))]
 627: 5 [map #<procedure e31ca0 at ice-9/boot-9.scm:3513:25 (mif-args)> ((#))]
3514: 4 [#<procedure e31ca0 at ice-9/boot-9.scm:3513:25 (mif-args)> (#)]
2786: 3 [resolve-interface (opencog exec) #:select ...]
In unknown file:
   ?: 2 [scm-error misc-error #f "~A ~S" ("no code for module" (opencog exec)) #f]
In ice-9/boot-9.scm:
 102: 1 [#<procedure 262cd00 at ice-9/boot-9.scm:97:6 (thrown-k . args)> misc-error ...]
In unknown file:
   ?: 0 [apply-smob/1 #<catch-closure 26881c0> misc-error ...]

ERROR: In procedure apply-smob/1:
ERROR: no code for module (opencog exec)
ABORT: misc-error
guile> 

import (opencog query) module as it loads execution binding

guile> (use-modules (opencog query))

guile> (cog-execute! a)
Backtrace:
In ice-9/boot-9.scm:
 157: 12 [catch #t #<catch-closure 23a7b00> ...]
In unknown file:
   ?: 11 [apply-smob/1 #<catch-closure 23a7b00>]
In ice-9/boot-9.scm:
 157: 10 [catch #t #<catch-closure 23a7640> ...]
In unknown file:
   ?: 9 [apply-smob/1 #<catch-closure 23a7640>]
   ?: 8 [call-with-input-string "(cog-execute! a)\n" ...]
In ice-9/boot-9.scm:
2320: 7 [save-module-excursion #<procedure 24921b0 at ice-9/eval-string.scm:65:9 ()>]
In ice-9/eval-string.scm:
  44: 6 [read-and-eval #<input: string 2498c30> #:lang ...]
  37: 5 [lp (cog-execute! a)]
In ice-9/eval.scm:
 386: 4 [eval #<memoized (cog-execute! a)> ()]
 393: 3 [eval #<memoized cog-execute!> ()]
In unknown file:
   ?: 2 [memoize-variable-access! #<memoized cog-execute!> #<directory # e85c60>]
In ice-9/boot-9.scm:
 102: 1 [#<procedure 2494b80 at ice-9/boot-9.scm:97:6 (thrown-k . args)> unbound-variable ...]
In unknown file:
   ?: 0 [apply-smob/1 #<catch-closure 23a7600> unbound-variable ...]

ERROR: In procedure apply-smob/1:
ERROR: Unbound variable: cog-execute!
ABORT: unbound-variable
guile> 
williampma commented 9 years ago

Did you do the (add-to-load-path "/usr/local/share/opencog/scm") from the deja vu issue https://github.com/opencog/atomspace/issues/87?

amebel commented 9 years ago

Forgetful me, thanks that was it.