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.)
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.
-- Linas
On Wed, Feb 26, 2020 at 5:23 AM Alexander Gabriel <[email protected]> wrote:
> Hiya everyone!
>
> Here is another problem that I ran into. When a query contains grounded
> atoms those are ignored (not evaluated) when considering the output.
> To demonstrate that I created this small example.
>
>
> (use-modules (opencog) (opencog logger) (opencog exec) (opencog ure))
> (define rbs (Concept "foo"))
> (ure-set-maximum-iterations rbs 30)
>
>
>
>
> (load-from-path
> "/home/rasberry/git/pln/opencog/pln/rules/propositional/crisp-conjunction-introduction.scm"
> )
> (Member (DefinedSchema "true-conjunction-introduction-2ary-rule") rbs)
>
>
>
>
> (cog-logger-set-level! (cog-ure-logger) "debug")
> (cog-logger-set-stdout! (cog-ure-logger) #t)
>
>
> (define true (Concept "true"))
> (define false (Concept "false"))
>
>
> (define hungry (Concept "hungry"))
> (define thirsty (Concept "thirty"))
>
>
> (define alice (Concept "alice"))
>
>
>
>
> (State (stv 1.0 1.0) (List alice hungry) true)
> (State (stv 1.0 1.0) (List alice thirsty) false)
>
>
>
>
> (define variables (VariableList
> (TypedVariable
> (Variable "person")
> (Type "ConceptNode"))))
>
>
>
>
> ; NOTE: These returns (SetLink ) as they should, alice isnt thirsty, the
> second StateLink is evaluated correctly.
> ; (define target (And (State (List (Variable "person") hungry) true)
> ; (State (List (Variable "person") thirsty) true)))
> ; (cog-bc rbs target #:vardecl variables)
> ; (cog-execute! (Get variables target))
>
>
>
>
> ; NOTE: This doesnt evaluate the grounded second state and that ends up
> with an erroneous (stv 1.0 0.0) instead of (stv 0.0 1.0) which follows
> from the existence of (State (stv 1.0 1.0) (List alice thirsty) false). As
> a result it returns a result with second StateLink and AndLink at
> erroneous (stv 1.0 0.0). Is there a way to force the chainer to evaluate
> already grounded atoms as well?
> (define target (And (State (List (Variable "person") hungry) true)
> (State (List alice thirsty) true)))
> (cog-bc rbs target #:vardecl variables)
>
>
> ; This returns (SetLink (ConceptNode "alice")), also ignoring the
> already grounded StateLink
> (cog-execute! (Get variables target))
>
>
>
> Shouldn't those grounded atoms be evaluated and considered?
>
> 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/5f6d23a9-a847-4fcb-85a2-a822cb1251f2%40googlegroups.com
> <https://groups.google.com/d/msgid/opencog/5f6d23a9-a847-4fcb-85a2-a822cb1251f2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
cassette tapes - analog TV - film cameras - you
--
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/CAHrUA364Soe4DzfNwq3%2BCg5TK7_YsLW4ddCFnz7uverRE8KJZQ%40mail.gmail.com.