Am Mittwoch, 26. Februar 2020 18:22:29 UTC schrieb linas:
>
> Hi Alex,
>
> The answer: yes, or rather no, and there's a bug in your example.
>
> The URE is built on top of the pattern matcher, and as mentioned earlier,
> the pattern matcher never alters truth values, and rarely looks at them, as
> it is only concerned with the presence/absence of patterns in the
> atomspace. As a URE user, you are welcome to write rules that examine
> truth values, and alter them in any way that you want. (I assume that one
> can also write URE rules that manipulate Values in general, but this may be
> cutting-edge, missing functions and utilities...) (see also
> /examples/atomspace/formulas.scm which presents the recommended way of
> handling these kinds of computations.)
>
But my goal wasn't to alter the value, just to have it looked up. But you
know that already ;)
If you ask me, we should remove the assumption of the default truth value
upon atom creation. Truth value definition should mean truth value
changing, and not defining it should just create a pattern that one can
feed to the system to query the truth values of a complex pattern. Unless
there is another way to make a grounded complex query that I'm not aware
of. (In which case please point me in the right direction ;)
>
> The bug is here:
> (define target (And (State (List (Variable "person") hungry) true)
> (State (List alice thirsty) true)))
>
> When you entered that, you just changed Alice's state. You didn't mean to,
> but atoms are globally-unique, and a StateLink can only have one state, so
> when the evaluator first sees that, it changes Alice's state, irrespective
> of it being wrapped up in the AndLink.
>
> To add insult to injury, the pattern matcher completely ignores the second
> StateLink, because it has no variables in it, and thus is trivially present
> in the atomspace. I guess that the URE can still examine it, and do
> something with it's truth value, depending on which rule got triggered.
>
If I could get my wish of definable patterns to query complex truth states,
I'd expect the matcher to go collect those truth values. As it is now, I'd
expect it to throw an error and tell people that they're changing the KB
state. Silently changing the KB state as well as silently assuming the
truth value of the grounded atoms is default (regardless of what it's
defined to be) seems like the worst choice.
I tried an updated query that now also sets the truthvalue of the second
StateLink, this confirms the truth value is seen as default in the AndLink:
(SetLink
(AndLink
(StateLink (stv 1.000000 1.000000)
(ListLink
(ConceptNode "alice") ; [6edb97fb269f42cf][1]
(ConceptNode "hungry") ; [242c0228b7502b75][1]
) ; [bcc08bf365c085ef][1]
(ConceptNode "true") ; [5ef6364983aee0cf][1]
) ; [84868fb1d3520298][1]
(StateLink (stv 1.000000 1.000000)
(ListLink
(ConceptNode "alice") ; [6edb97fb269f42cf][1]
(ConceptNode "thirty") ; [16526f8a1adbc29][1]
) ; [db02447762e2d55b][1]
(ConceptNode "true") ; [5ef6364983aee0cf][1]
) ; [d3f761667ca45d1d][1]
) ; [d9a46b0c6194b7b8][1]
) ; [e6b35cc2f9480d13][1]
Best,
Alex
--
You received this message because you are subscribed to the Google Groups
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/opencog/32f60c81-bc1a-48a8-b50d-65d30a5e0d1e%40googlegroups.com.