| Paste number 59869: | gdb output |
| Pasted by: | Hasone |
| 4 months, 1 week ago | |
| #dylan | Context in IRC logs | |
| Paste contents: |
| [Thread debugging using libthread_db enabled] [New Thread -1214974288 (LWP 16430)] Unknown format dispatch character, Program received signal SIGABRT, Aborted. [Switching to Thread -1214974288 (LWP 16430)] 0xffffe410 in __kernel_vsyscall () (gdb) when Undefined command: "when". Try "help". (gdb) where #0 0xffffe410 in __kernel_vsyscall () #1 0xb7986875 in raise () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7988201 in abort () from /lib/tls/i686/cmov/libc.so.6 #3 0xb7cc410f in dylanZdylan_visceraZinvoke_debugger_METH () from /usr/local/lib/dylan/2.4.0/x86-linux-gcc/libdylan-dylan.so.0 #4 0x080d1008 in ?? () #5 0xb7cdbfa0 in ?? () from /usr/local/lib/dylan/2.4.0/x86-linux-gcc/libdylan-dylan.so.0 #6 0x00000001 in ?? () #7 0x0809fb30 in standard_ioZstandard_ioZVstandard_outputV () #8 0xb7d09dc0 in ?? () from /usr/local/lib/dylan/2.4.0/x86-linux-gcc/libdylan-dylan.so.0 #9 0x00000000 in ?? () |
Annotations for this paste:
| Annotation number 1: | hasone's program |
| Pasted by: | hasone |
| 4 months, 1 week ago | |
| Context in IRC logs | |
| Paste contents: |
| /* module: nerves define variable bond-names = #["north", "south", "east", "west"]; define class <nerve> (<Object>) slot activation-level :: <real> = 0; slot type :: <nerve-type>, init-keyword: type:, init-value: make(<computation>); slot bonds :: <string-table> = init-bond-slot(0); slot bond-activated :: <string-table> = init-bond-slot(#f); end class; define method init-bond-slot(value) => (bond-slot :: <table>) let bond-slot :: <table> = make(<string-table>); for(i :: <integer> from 0 to 3) bond-slot[bond-names[i]] := value; end for; bond-slot; end method init-bond-slot; define method transmit-impulse(net :: <neural-network>, sender-coords :: <sequence>) => (sender :: <nerve> ) let sender = net.network[sender-coords[0], sender-coords[1]]; for(i :: <integer> from 0 to 3) sender.bond-activated[bond-names[i]] := #t; end for; if(sender.bond-activated["west"]) format-out("good"); end if; if(~sender.bond-activated["west"]) format-out("bad"); end if; if(sender-coords[0] = 0) sender.bond-activated["west"] := #f; end if; if(sender-coords[1] = 0) sender.bond-activated["south"] := #f; end if; if(sender-coords[0] = 5) sender.bond-activated["east"] := #f; end if; if(sender-coords[1] = 5) sender.bond-activated["north"] := #f; end if; sender; end method transmit-impulse; define method test-transmit-impulse() let net :: <neural-network> = make(<neural-network>); let sender :: <nerve> = (net.network)[0,1]; let test-passed :: <boolean> = #t; sender := transmit-impulse(net, #[0,1]); test-passed := sender.bond-activated["north"]; test-passed := (sender.bond-activated["west"]); if(~sender.bond-activated["west"]) format-out("huh?"); end if; test-passed := check-true(sender.bond-activated["north"], "N not active, should be", test-passed); test-passed := check-true(sender.bond-activated["east"], "E inactive, should be", test-passed); //the next two statements don't work, test-passed:= sender.bond-activated["west"] yields the same error test-passed := check-true(sender.bond-activated["west"], "W should be active", test-passed); test-passed := check-true(~sender.bond-activated["south"], "south bond should NOT be activated", test-passed); report("test-transmit-impulse", test-passed); end method test-transmit-impulse; define class <neural-network> (<Object>) slot network :: <array> = make(<array>, dimensions: #[6,6]); slot time :: <integer> = 0; end class <neural-network>; define method initialize(net :: <neural-network>, #key keywords) => (net :: <neural-network>) next-method(); net.network := fill-network(net.network); net.network := initialize-special-neurons(net.network); net; end method initialize; define method fill-network(network-array :: <array>) for(i :: <integer> from 0 to 5) for(j :: <integer> from 0 to 5) network-array[i,j] := make(<nerve>); end for; end for; network-array; end method fill-network; define method initialize-special-neurons(neural-network :: <array>) neural-network[0 , 0].type := make(<feedback-signal>); neural-network[0 , 1].type := make(<add-signal>); neural-network[0,2].type := make(<sign-flag>); for(i :: <integer> from 3 to 5) neural-network[0 , i].type := make(<binary-input>); end for; for(i :: <integer> from 1 to 3) neural-network[5,i].type := make(<binary-output>); end for; neural-network; end method; define method add-test(suite :: <suite>, test :: <function>) => (suite :: <sequence>) suite.tests := add (suite.tests, test); end method add-test; define method check-true(predicate :: <boolean>, failure-message :: <string>, test-passed :: <boolean>) if(test-passed ) test-passed := predicate; if(~test-passed) format-out(failure-message); end if; end if; test-passed; end method check-true; define method check-equal (first-object, second-object, failure-message :: <string>, test-passed :: <boolean>) check-true((first-object = second-object), failure-message, test-passed); end method check-equal; define method report(test-name :: <string>, test-passed? :: <boolean>) if ( test-passed?) format-out(" %s passed\n", test-name); else format-out("% s failed\n", test-name); end if end method report; |