From OpenCog

The FormulaTruthValue is a kind of TruthValue that holds a numeric formula within it. Whenever it is polled for it's current numeric value, that formula is automatically executed to obtain those numbers. Functionally, it always returns a SimpleTruthValue as the result.

The FormulaStream generalizes this idea to arbitrary FloatValues. That is, a FormulaTruthValue returns a vector of length two (the strength and confidence), whereas the FormulaStream can be used to compute vectors of arbitrary length.


The following defines a FormulaTruthValue that computes a new SimpleTruthValue based on the TruthValues on (Concept "A") and (Concept "B").

         (Number 1)
            (StrengthOf (Concept "A"))
            (StrengthOf (Concept "B"))))
         (ConfidenceOf (Concept "A"))
         (ConfidenceOf (Concept "B")))))

Usually, FormulaTruthValues are not used directly, but are instead created by the DynamicFormulaLink, which will take a formula, create the TV, and install it into place.

A more detailed exploration can be found in the /examples/atomspace/flow-formulas.scm file.