>> It doesn't look like I can add the variables using an optional argument: > >It would be strange if such argument hasn't been ported. Any idea about >that Vitaly (or someone else)?
Yes it is ported, the name of the parameter is `vardecl`. I believe the following should work: ``` variables = VariableList(VariableNode("origin"), VariableNode("destination")) chainer = BackwardChainer(atomspace, rbs, query, vardecl=variables) ``` >Vitaly, please tell Alex how to set the ure logger level if he doesn't >know how. URE logger is not ported into Python API, the simplest way to set its level I know is: ``` scheme_eval(atomspace, '(use-modules (opencog logger) (opencog ure))') scheme_eval(atomspace, '(cog-logger-set-level! (cog-ure-logger) "DEBUG")') ``` >Also how can we find documentation about the Python API of the >URE (I probably should learn it as well)? There is no specific about Python API for URE it copies C++ API as far as I know. There is an example on Python OpenCog API wiki: https://wiki.opencog.org/w/Python#Backward_Chainer One can also look at unit tests: https://github.com/opencog/ure/tree/master/tests/cython Best regards, Vitaly On Monday, January 13, 2020 at 9:46:06 AM UTC+3, Nil wrote: > > Hi Alex, Vitaly, > > Alex, please set the level of the ure logger to debug and attach the log > file here. > > Vitaly, please tell Alex how to set the ure logger level if he doesn't > know how. Also how can we find documentation about the Python API of the > URE (I probably should learn it as well)? > > Thanks, > Nil > > On 1/11/20 12:50 AM, Alexander Gabriel wrote: > > > > > > Am Freitag, 10. Januar 2020 22:44:45 UTC schrieb linas: > > > > I'm not sure what to make of the email below. By "query", do you > > mean "run cog-execute! on a BindLink"? > > > > > > I'm running this: > > > > | > > queries = [] > > > > # WARN: if I add this to the queries it adds the links to the > > atomspace (as it should I guess) > > # and proceeds to return the results for the just added links, > > truth values differ over distances > > > > > > queries.append(StateLink( > > ConceptNode(config.robot_name), > > VariableNode("origin"))) > > > > queries.append(StateLink( > > ConceptNode(config.picker_name), > > VariableNode("destination"))) > > > > queries.append(StateLink( > > ListLink(VariableNode("picker"), > > PredicateNode("seen_picking")), > > ConceptNode("FALSE"))) > > > > queries.append(StateLink( > > ListLink(VariableNode("picker"), > PredicateNode("has_crate")), > > ConceptNode("FALSE"))) > > > > queries.append( > > EvaluationLink( > > PredicateNode("linked"), > > ListLink( > > > ConceptNode("WayPoint{:03d}".format(config.robot_pos)), > > > > ConceptNode("WayPoint{:03d}".format(config.picker_pos))))) > > > > > > # this returns results only for predefined links, but even > > there the truth value has zero confidence > > queries.append( > > AndLink( > > StateLink( > > ConceptNode(config.robot_name), > > VariableNode("origin")), > > StateLink( > > ConceptNode(config.picker_name), > > VariableNode("destination")), > > StateLink( > > ListLink(VariableNode("picker"), > > PredicateNode("seen_picking")), > > ConceptNode("FALSE")), > > StateLink( > > ListLink(VariableNode("picker"), > > PredicateNode("has_crate")), > > ConceptNode("FALSE")), > > EvaluationLink( > > PredicateNode("linked"), > > ListLink( > > VariableNode("origin"), > > VariableNode("destination"))))) > > > > for query in queries: > > print("Query: {:}\n".format(query)) > > chainer = BackwardChainer(atomspace, > > rbs, > > query) > > chainer.do_chain() > > results = chainer.get_results() > > print("Result {:}".format(results)) > > try: > > print("Truth: {:}".format(results.get_out()[0].tv)) > > except: > > pass > > print("\n\n") > > | > > > > here is a link to the rest of the code > > < > https://gist.github.com/alexander-gabriel/59f06eb3d0f2ffa02b161f9dbca1a12c> > which > > > defines the contents of the atomspace. > > > > -- > > 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 ope...@googlegroups.com <javascript:> > > <mailto:ope...@googlegroups.com <javascript:>>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/opencog/7f1d2406-3902-4677-bf35-ebea7d64a0e8%40googlegroups.com > > > < > https://groups.google.com/d/msgid/opencog/7f1d2406-3902-4677-bf35-ebea7d64a0e8%40googlegroups.com?utm_medium=email&utm_source=footer>. > > > -- 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 opencog+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/a26864a7-a0a9-47e3-a25a-d520df4361da%40googlegroups.com.