Running scheme commands issue

39 views
Skip to first unread message

Randy Deborggraeve

unread,
Jan 28, 2018, 4:40:26 PM1/28/18
to opencog
I'm having some issues running SCM modules. Not sure what changed on my system, but even the atomspace BasicSCM unit test fails.

Scheme command '(Node \"ola amigos\" (stv 0,200000 0,300000))' returns the following error:
[2018-01-28 21:29:50:025] [DEBUG] Backtrace:
           
9 (apply-smob/1 #<catch-closure 1edd500>)
           
8 (apply-smob/1 #<catch-closure 1ee5ec0>)
In ice-9/boot-9.scm:
   
2316:4  7 (save-module-excursion #<procedure 1ee4c80 at ice-9/eva…>)
In ice-9/eval-string.scm:
     
38:6  6 (read-and-eval #<input: string 2182690> #:lang _)
In ice-9/eval.scm:
   
196:43  5 (_ #f)
   
196:35  4 (_ #f)
   
223:20  3 (proc #<directory (guile-user) 1e040a0>)
In unknown file:
           
2 (%resolve-variable (7 . #{0,200000}#) #<directory (guil…>)
In ice-9/boot-9.scm:
   
759:25  1 (dispatch-exception 0 unbound-variable (#f "Unbound …" …))
In unknown file:
           
0 (apply-smob/1 #<catch-closure 1ee5e80> unbound-variable …)

ERROR
: In procedure apply-smob/1:
ERROR
: Unbound variable: #{0,200000}#
ABORT
: unbound-variable


I have no clue what is causing this or how to fix. Seems this is not even a opencog related error :(
Already rebuild/installed all modules, cleared the .cache/guile folder, ...

Ed Guy

unread,
Jan 28, 2018, 4:50:01 PM1/28/18
to opencog
Which OS and what opencog-related modules are installed?
/ed

Linas Vepstas

unread,
Jan 28, 2018, 4:57:38 PM1/28/18
to opencog
You have commas in your numeric values.  Scheme sees the comma in 0,2000 and gets confused.

This might be due to some locale setting, somewhere.

Also, having the backslash before the quotes is bizzarre ... that is not normally needed, and I'm certain it will confuse scheme also, unless seomthing else is removing the backslash before passing it to  guile.

--linas

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to 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/eed44fab-2935-41f6-9c4b-1196735274ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
cassette tapes - analog TV - film cameras - you

Randy Deborggraeve

unread,
Jan 29, 2018, 2:02:07 AM1/29/18
to ope...@googlegroups.com
Im running on Ubuntu 16.04 with cogutil, atomspace, moses & opencog building from source.

The reasson of the backslashes is cause i copy pasted that line from a c++ application running scheme commando's. Its easier to debug and working toward a ROS node that can run SCM.

But for example, the following will succeed if called from c++ of directly in guile:
(nlp-parse "test")
while this fails
(nlp-parse "Test")

Op 28 jan. 2018 22:57 schreef "Linas Vepstas" <linasv...@gmail.com>:

Randy Deborggraeve

unread,
Jan 29, 2018, 3:33:03 PM1/29/18
to opencog
Linas,

U are right about the comma's.
Put some console output in the BasicSCMUTest and it seems the printf functions put a comma separator for decimal number. (BasicSCMUTest.cxxtest line 162 & 164)
Not sure whats causing this, but this seems to be the cause of all my issues :(
I had copied the scheme string i use in my c++ test application from debugging the unit test (standalone app also bit easier to debug), so thats why i had the comma's

Also made a simple test to see if this is related to my system settings, but this turns out to print with dot instead of comma ...

#include <stdio.h>
#include <iostream>

int main()
{
       
float x = 0.2f;
       
float y = 0.3f;

       
char buff[500];
        snprintf
(buff, 500, ("%f, %f"), x, y);

        std
::cout << buff << std::endl;

       
return 0;
}



result: 0.200000, 0.300000

when i add setlocale(LC_ALL, ""); to my little test, i also get comma formatting

Linas Vepstas

unread,
Jan 29, 2018, 4:38:02 PM1/29/18
to opencog
On Mon, Jan 29, 2018 at 1:02 AM, Randy Deborggraeve <randy.deb...@gmail.com> wrote:

But for example, the following will succeed if called from c++ of directly in guile:
(nlp-parse "test")
while this fails
(nlp-parse "Test")

I don't know what you mean by succeed/fail.  There are many steps in the pipeline. Lower-case "test" can be interpreted as a zero copula noun-assertion "[This is a] test".   Uppercase Test can be interpreted as the the former, since words at the beginning of sentences are capitalized. It can also be interpreted as a proper name: some corporation whose name is Test, or some person.

If the parser suggests a proper name, and later parts of the pipeline (such as R2L) don't handle proper names, then there's an error.

The low-level parser makes multiple suggestions, but the higher level stages of the nlp pipeline ignore the multiple suggestions, and pick only the first.  What should probably happen is that  if the first parse is bad or uninterpretable, then try again with the second one, and see if that works, etc. That would require some amount of fiddling with the guts of the pipeline.

--linas

For more options, visit https://groups.google.com/d/optout.

Linas Vepstas

unread,
Jan 29, 2018, 4:43:42 PM1/29/18
to opencog
On Mon, Jan 29, 2018 at 2:33 PM, Randy Deborggraeve <randy.deb...@gmail.com> wrote:


when i add setlocale(LC_ALL, ""); to my little test, i also get comma formatting

Dunno. Comma formating in number printing is a typical european setting. Locale settings are done kind of piecemeal throughout the operating system, by word-processors, keyboard drivers, input method applets, .bashrc scripts in your home dir and in /etc/bashrc and so on etc.

If you are patient, you might discover where this is set by using strace, and looking at what code where is setting the local to what. e.g. glibc probably sets it based on some config file in /etc

--linas
Reply all
Reply to author
Forward
0 new messages