OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-sensory commits / a4cb862

crazy-making
a4cb8629d79f0ae8630e63e779d1ebf2c53b0525
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-19T05:36:04.000Z

Changed files (1) +46 -0

sandbox/bootstrap.scm +46 -0
……@@ -16,6 +16,8 @@
1616
1717; Create a handle we can hold onto.
1818; Compact but too circular.
19
20(use-modules (opencog))
1921(Pipe
2022 (Name "make-as")
2123 (AtomSpace (AtomSpaceOf (Name "make-as"))))
……@@ -38,6 +40,29 @@
3840(cog-set-atomspace! (cog-execute! (Name "make-as")))
3941
4042
43;; The following has unexpected results:
44(use-modules (opencog))
45(define base-as (cog-atomspace))
46(define named-as (AtomSpace (cog-name (cog-atomspace))))
47(cog-equal? base-as named-as) ; currently prints #t
48(Concept "foo") ;; add contents to base-as
49(cog-prt-atomspace) ;; view contents of base-as
50(cog-set-atomspace! named-as) ;; change to the other atomspace
51(cog-prt-atomspace) ;; view contents of named-as -- its empty
52(Concept "I'm in named")
53(cog-prt-atomspace) ;; view contents of named-as -- its empty
54(cog-set-atomspace! base-as) ;; return to the original as
55(cog-prt-atomspace) ;; view contents -- we can see the "foo" here
56(define nuther-as (AtomSpace (cog-name (cog-atomspace))))
57(cog-set-atomspace! nuther-as) ;; return to the original as
58(cog-prt-atomspace) ;; view contents --
59;; So clearly these two AtomSpaces are NOT the same; one has
60;; (Concept "foo") in it and the other does not. The problem is
61;; that they *should have been* the same AtomSpace -- the name
62;; should have been enough to guarentee that broth reference the
63;; same space. But somehow something is broken... what is broken?
64
65
4166(AtomSpace "bootstrap" (AtomSpaceOf (Link)))
4267
4368(cog-execute!
……@@ -60,9 +85,30 @@
6085 ; Where? In the child AtomSpace
6186 (AtomSpace "bootstrap")))
6287
88(define bas (cog-atomspace))
89(cog-set-atomspace! (AtomSpace "bootstrap"))
90
6391(cog-execute!
6492 (SetValue
6593 (RocksStorageNode "rocks:///tmp/foo")
6694 (Predicate "*-store-atom-*")
6795 (Concept "I'm from storage")))
6896
97(cog-set-atomspace! (AtomSpace "bootstrap"))
98(define (ola) (format #t "hello baby!\n"))
99(define pip
100(Pipe
101 (Name "bootloader")
102 (ExecutionOutput
103 (GroundedSchema "scm:ola")
104 (List)))
105)
106(cog-execute!
107 (SetValue
108 (RocksStorageNode "rocks:///tmp/foo")
109 (Predicate "*-store-atom-*")
110 pip))
111
112(cog-execute! (Name "bootloader"))
113
114