OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-sensory commits / 99cf955

Named pipe version
99cf95599e9c9178866d0fe9cd50999c21026628
by Linas Vepstas <linas@linas.org> · 2026-01-03T02:41:50.000Z

Changed files (1) +35 -0

sandbox/count.scm +35 -0
……@@ -49,3 +49,38 @@
4949 get-types))
5050
5151(cog-execute! count-types)
52
53; -------------------------------------------
54(use-modules (opencog))
55
56(PipeLink
57 (Name "get-all-atoms")
58 (Meet
59 (Variable "$atom") ; vardecl
60 (Variable "$atom") ; match anything
61 ))
62
63; (cog-execute! (Name "get-all-atoms"))
64
65(PipeLink
66 (Name "get-types")
67 (Filter
68 (Rule
69 (TypedVariable (Variable "$atom") (Type 'Atom)) ; vardecl
70 (Variable "$atom") ; body - accept everything
71 (TypeOf (DontExec (Variable "$atom"))))
72 (Name "get-all-atoms")))
73
74; (cog-execute! (Name "get-types"))
75
76(Pipe
77 (Name "count-types")
78 (Filter
79 (Rule
80 (TypedVariable (Variable "$typ") (Type 'Type)) ; vardecl
81 (Variable "$typ") ; body - accept everything
82 (IncrementValue (Variable "$typ") (Predicate "cnt") (Number 0 0 1)))
83 (Name "get-types")))
84
85(cog-execute! (Name "count-types"))
86