OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / e961262

Rename tvp in the demo code
e96126201b29462dfe2d92affaa288095bf52248
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-23T05:14:32.000Z

Changed files (1) +11 -11

examples/flow/flow-futures.scm +11 -11
……@@ -23,13 +23,13 @@
2323; on pairs, as well as on marginals.
2424
2525; Counts are located in the third slot of the TV predicate.
26(define tvp (PredicateNode "*-TruthValueKey-*"))
26(define cvp (PredicateNode "*-CountingKey-*"))
2727
2828(define (incr-counts THING-A THING-B)
29 (cog-inc-value! (List THING-A THING-B) tvp 1.0 2)
30 (cog-inc-value! (List (AnyNode "left wildcard") THING-B) tvp 1.0 2)
31 (cog-inc-value! (List THING-A (AnyNode "right wildcard")) tvp 1.0 2)
32 (cog-inc-value! (AnyNode "grand total") tvp 1.0 2))
29 (cog-inc-value! (List THING-A THING-B) cvp 1.0 2)
30 (cog-inc-value! (List (AnyNode "left wildcard") THING-B) cvp 1.0 2)
31 (cog-inc-value! (List THING-A (AnyNode "right wildcard")) cvp 1.0 2)
32 (cog-inc-value! (AnyNode "grand total") cvp 1.0 2))
3333
3434; Same as above, but works with strings. It counts how often a pair
3535; was "observed".
……@@ -55,11 +55,11 @@
5555 (Log2
5656 (Divide
5757 (Times
58 (FloatValueOf (List (Variable "$L") (Variable "$R")) tvp)
59 (FloatValueOf (AnyNode "grand total") tvp))
58 (FloatValueOf (List (Variable "$L") (Variable "$R")) cvp)
59 (FloatValueOf (AnyNode "grand total") cvp))
6060 (Times
61 (FloatValueOf (List (Variable "$L") (Any "right wildcard")) tvp)
62 (FloatValueOf (List (Any "left wildcard") (Variable "$R")) tvp))))))
61 (FloatValueOf (List (Variable "$L") (Any "right wildcard")) cvp)
62 (FloatValueOf (List (Any "left wildcard") (Variable "$R")) cvp))))))
6363
6464; A utility to install the above formula on a pair.
6565; The CollectionOfLink is used to wrap the formula with a FormulaStream.
……@@ -137,13 +137,13 @@
137137(cog-execute!
138138 (Decimate
139139 (BoolValueOf (Concept "someplace") (Predicate "mask key"))
140 (FloatValueOf (AnyNode "grand total") tvp)))
140 (FloatValueOf (AnyNode "grand total") cvp)))
141141
142142; Wrap it in a utility constructor
143143(define (make-deci ATOM)
144144 (Decimate
145145 (BoolValueOf (Concept "someplace") (Predicate "mask key"))
146 (FloatValueOf ATOM tvp)))
146 (FloatValueOf ATOM cvp)))
147147
148148; A new procedure, that works only on the one item.
149149(DefineLink