OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / eede12b

More conversion to purer Atomese
eede12b8bfa271b7795930446e0d58965085d6d7
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-23T05:39:23.000Z

Changed files (1) +8 -5

examples/flow/flow-futures.scm +8 -5
……@@ -22,9 +22,11 @@
2222; Below is a toy pair-counting framework. It increments counts
2323; on pairs, as well as on marginals.
2424
25; Counts are located in the third slot of the TV predicate.
25; Counts are located in the third slot of the predicate.
26; Why the third? Historical precedent, plus it makes for a good demo:
27; one can work with vectors of numbers, as one pleases.
2628(define cvp (PredicateNode "*-CountingKey-*"))
27(define one (NumberNode 1))
29(define one (NumberNode 0 0 1))
2830
2931(define (incr-counts THING-A THING-B)
3032 (Trigger (IncrementValue
……@@ -84,7 +86,7 @@
8486
8587; Get the value
8688(define (get-computed-value THING-A THING-B)
87 (cog-value (List THING-A THING-B) (Predicate "MI Key")))
89 (ValueOf (List THING-A THING-B) (Predicate "MI Key")))
8890
8991(define (get-mi-stream STRING-A STRING-B)
9092 (get-computed-value (Concept STRING-A) (Concept STRING-B)))
……@@ -93,7 +95,7 @@
9395; OK, we're done. Lets see what happens.
9496
9597(install-mi "hello" "world")
96(get-mi-stream "hello" "world")
98(Trigger (get-mi-stream "hello" "world"))
9799
98100; Well, that's messy! But it does show the full structure of
99101; what was set up. Note that the formulas were applied to the
……@@ -110,7 +112,8 @@
110112
111113; We really only want the third number. So grab that.
112114(define (get-mi STRING-A STRING-B)
113 (cog-value-ref (get-mi-stream STRING-A STRING-B) 2))
115 (Trigger
116 (ElementOf (Number 2) (get-mi-stream STRING-A STRING-B))))
114117
115118(get-mi "hello" "world")
116119