| … | … | @@ -142,10 +142,10 @@ |
| 142 | 142 | (BoolValue 0 0 1)) |
| 143 | 143 | |
| 144 | 144 | ; Verify that masking works |
| 145 | | (cog-execute! |
| 145 | (Trigger |
| 146 | 146 | (Decimate |
| 147 | 147 | (BoolValueOf (Concept "someplace") (Predicate "mask key")) |
| 148 | | (FloatValueOf (AnyNode "grand total") cvp))) |
| 148 | (FloatValueOf (List (Any "left wildcard") (Any "right wildcard")) cvp))) |
| 149 | 149 | |
| 150 | 150 | ; Wrap it in a utility constructor |
| 151 | 151 | (define (make-deci ATOM) |
| … | … | @@ -162,7 +162,7 @@ |
| 162 | 162 | (Divide |
| 163 | 163 | (Times |
| 164 | 164 | (make-deci (List (Variable "$L") (Variable "$R"))) |
| 165 | | (make-deci (AnyNode "grand total"))) |
| 165 | (make-deci (List (Any "left wildcard") (Any "right wildcard")))) |
| 166 | 166 | (Times |
| 167 | 167 | (make-deci (List (Variable "$L") (Any "right wildcard"))) |
| 168 | 168 | (make-deci (List (Any "left wildcard") (Variable "$R")))))))) |
| … | … | @@ -171,7 +171,7 @@ |
| 171 | 171 | ; As before. |
| 172 | 172 | (define (install-scalar THING-A THING-B) |
| 173 | 173 | (define pair (List THING-A THING-B)) |
| 174 | | (cog-execute! |
| 174 | (Trigger |
| 175 | 175 | (SetValue pair (Predicate "Alt MI Key") |
| 176 | 176 | (CollectionOf (Type 'FormulaStream) (OrderedLink |
| 177 | 177 | (ExecutionOutput (DefinedProcedure "scalar MI") pair)))))) |
| … | … | @@ -182,10 +182,10 @@ |
| 182 | 182 | |
| 183 | 183 | ; Get the value |
| 184 | 184 | (define (get-computed-scalar THING-A THING-B) |
| 185 | | (cog-value (List THING-A THING-B) (Predicate "Alt MI Key"))) |
| 185 | (ValueOf (List THING-A THING-B) (Predicate "Alt MI Key"))) |
| 186 | 186 | |
| 187 | 187 | (define (get-mi-scalar STRING-A STRING-B) |
| 188 | | (get-computed-scalar (Concept STRING-A) (Concept STRING-B))) |
| 188 | (Trigger (get-computed-scalar (Concept STRING-A) (Concept STRING-B)))) |
| 189 | 189 | |
| 190 | 190 | ; Try it out. Need to install it before first use. |
| 191 | 191 | (install-scalar-mi "hello" "world") |