DefinedPredicateNode vs BackwardChainer

51 views
Skip to first unread message

Alexander Gabriel

unread,
Apr 27, 2020, 12:54:50 PM4/27/20
to opencog
Hiya!

I've stumbled upon a new problem I could use your help with.

I've been trying to run a very rudimentary example to understand what goes wrong here:

If I run the queries below through the backward chainer, query_A with the PredicateNode works fine, but if I run query_B with the DefinedPredicateNode, I end up with the log attached at the bottom of this post.

I think, I need to create a PLN rule that replaces DefinedPredicateNodes with their respective definition...(I haven't found one).... is that correct?

Best regards,
Alex

pseudo code:
someone = ConceptNode("bob")

someone
.set_value(PredicateNode("height"), FloatValue(1.9))


EvaluationLink(
       
PredicateNode("is_tall_A"),
        someone
)

EvaluationLink(
       
PredicateNode("is_tall_B"),
        someone
)





DefineLink(
       
DefinedPredicateNode("tall_B"),
       
LambdaLink(
               
VariableNode("X"),
               
GreaterThanLink(
                       
ValueOfLink(
                               
VariableNode("X"),
                               
PredicateNode("height")
                       
),
               
NumberNode("1.75")
               
)
       
)
)


variables
= VariableList(TypedVariableLink(
               
VariableNode("person"),
               
TypeNode("ConceptNode")
       
)
)


query_A
= EvaluationLink(
                       
PredicateNode("is_tall_A"),
                       
VariableNode("person")
                   
)


query_B
= EvaluationLink(
                       
DefinedPredicateNode("is_tall_B"),
                       
VariableNode("person")
                   
)

debug log:
[2020-04-27 16:50:34:315] [DEBUG] Rule-base deduction-rule-base, set parameter URE:maximum-iterations to 100 [default]
[2020-04-27 16:50:34:315] [DEBUG] Rule-base deduction-rule-base, set parameter URE:complexity-penalty to 0.1
[2020-04-27 16:50:34:315] [DEBUG] Rule-base deduction-rule-base, set parameter URE:jobs to 1 [default]
[2020-04-27 16:50:34:315] [DEBUG] Rule-base deduction-rule-base, set parameter URE:FC:retry-exhausted-sources to 0 [default]
[2020-04-27 16:50:34:315] [DEBUG] Rule-base deduction-rule-base, set parameter URE:FC:full-rule-application to 0 [default]
[2020-04-27 16:50:34:315] [DEBUG] Rule-base deduction-rule-base, set parameter URE:BC:maximum-bit-size to -1 [default]
[2020-04-27 16:50:34:315] [DEBUG] Rule-base deduction-rule-base, set parameter URE:BC:MM:complexity-penalty to 0 [default]
[2020-04-27 16:50:34:315] [DEBUG] Rule-base deduction-rule-base, set parameter URE:BC:MM:compressiveness to 1 [default]
[2020-04-27 16:50:34:315] [DEBUG] Default inference rule TVs:
[2020-04-27 16:50:34:315] [DEBUG] Start backward chaining
[2020-04-27 16:50:34:315] [DEBUG] With rule set:
size
= 0
[2020-04-27 16:50:34:315] [DEBUG] Iteration 1/100
[2020-04-27 16:50:34:315] [DEBUG] Initialize BIT with:
(BindLink
 
(TypedVariableLink
   
(VariableNode "person") ; [40bf26ea112895be][1]
   
(TypeNode "ConceptNode") ; [3494df0ad0397660][1]
 
) ; [cfa066b73bf288dd][1]
 
(EvaluationLink
   
(DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
   
(VariableNode "person") ; [40bf26ea112895be][1]
 
) ; [c0a7dafcd6614da1][1]
 
(EvaluationLink
   
(DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
   
(VariableNode "person") ; [40bf26ea112895be][1]
 
) ; [c0a7dafcd6614da1][1]
) ; [de1d20a71923fa1f][4]
[2020-04-27 16:50:34:315] [DEBUG] Selected and-BIT for fulfillment (fcs value):
[de1d20a71923fa1f][4]
[2020-04-27 16:50:34:315] [DEBUG] Results:
size
= 0
[2020-04-27 16:50:34:315] [DEBUG] Iteration 2/100
[2020-04-27 16:50:34:315] [DEBUG] Weighted and-BITs:
1 [de1d20a71923fa1f][4]
[2020-04-27 16:50:34:315] [DEBUG] Selected and-BIT for expansion:
(BindLink
 
(TypedVariableLink
   
(VariableNode "person") ; [40bf26ea112895be][1]
   
(TypeNode "ConceptNode") ; [3494df0ad0397660][1]
 
) ; [cfa066b73bf288dd][1]
 
(EvaluationLink
   
(DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
   
(VariableNode "person") ; [40bf26ea112895be][1]
 
) ; [c0a7dafcd6614da1][1]
 
(EvaluationLink
   
(DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
   
(VariableNode "person") ; [40bf26ea112895be][1]
 
) ; [c0a7dafcd6614da1][1]
) ; [de1d20a71923fa1f][4]
[2020-04-27 16:50:34:315] [DEBUG] Selected BIT-node for expansion:
body
:
 
(EvaluationLink
   
(DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
   
(VariableNode "person") ; [40bf26ea112895be][1]
 
) ; [c0a7dafcd6614da1][1]
exhausted
: 0
rules
:
  size
= 0
[2020-04-27 16:50:34:315] [DEBUG] No valid rule for the selected BIT-node, abort expansion
[2020-04-27 16:50:34:315] [DEBUG] Cannot fulfill an empty and-BIT. Abort BIT fulfillment
[2020-04-27 16:50:34:315] [DEBUG] Iteration 3/100
[2020-04-27 16:50:34:315] [DEBUG] Weighted and-BITs:
1 [de1d20a71923fa1f][4]
[2020-04-27 16:50:34:316] [DEBUG] Selected and-BIT for expansion:
(BindLink
 
(TypedVariableLink
   
(VariableNode "person") ; [40bf26ea112895be][1]
   
(TypeNode "ConceptNode") ; [3494df0ad0397660][1]
 
) ; [cfa066b73bf288dd][1]
 
(EvaluationLink
   
(DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
   
(VariableNode "person") ; [40bf26ea112895be][1]
 
) ; [c0a7dafcd6614da1][1]
 
(EvaluationLink
   
(DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
   
(VariableNode "person") ; [40bf26ea112895be][1]
 
) ; [c0a7dafcd6614da1][1]
) ; [de1d20a71923fa1f][4]
[2020-04-27 16:50:34:316] [DEBUG] All BIT-nodes of this and-BIT are exhausted (or possibly fulfilled). Abort expansion.
[2020-04-27 16:50:34:316] [DEBUG] Cannot fulfill an empty and-BIT. Abort BIT fulfillment
[2020-04-27 16:50:34:316] [DEBUG] Terminate: all AndBITS are exhausted
[2020-04-27 16:50:34:316] [DEBUG] Finished backward chaining with results:
size
= 0
The BackwardChainer took 0.00



Nil Geisweiller

unread,
May 5, 2020, 4:10:54 AM5/5/20
to ope...@googlegroups.com, Alexander Gabriel
Hi Alex,

I think there is no reasoning needed here, a pattern matcher query would
suffice, that is said it the BC should succeed at the first iteration.

I see query_B is using DefinedPredicateNode("is_tall_B") while your
DefineLink is using "tall_B" maybe that's the problem.

Nil
> [2020-04-2716:50:34:315][DEBUG]InitializeBIT with:
> (BindLink
> (TypedVariableLink
> (VariableNode"person");[40bf26ea112895be][1]
> (TypeNode"ConceptNode");[3494df0ad0397660][1]
> );[cfa066b73bf288dd][1]
> (EvaluationLink
> (DefinedPredicateNode"is_tall_B");[633392579119c32][1]
> (VariableNode"person");[40bf26ea112895be][1]
> );[c0a7dafcd6614da1][1]
> (EvaluationLink
> (DefinedPredicateNode"is_tall_B");[633392579119c32][1]
> (VariableNode"person");[40bf26ea112895be][1]
> );[c0a7dafcd6614da1][1]
> );[de1d20a71923fa1f][4]
> [2020-04-2716:50:34:315][DEBUG]Selectedand-BIT forfulfillment (fcs value):
> [de1d20a71923fa1f][4]
> [2020-04-2716:50:34:315][DEBUG]Results:
> size =0
> [2020-04-2716:50:34:315][DEBUG]Iteration2/100
> [2020-04-2716:50:34:315][DEBUG]Weightedand-BITs:
> 1[de1d20a71923fa1f][4]
> [2020-04-2716:50:34:315][DEBUG]Selectedand-BIT forexpansion:
> (BindLink
> (TypedVariableLink
> (VariableNode"person");[40bf26ea112895be][1]
> (TypeNode"ConceptNode");[3494df0ad0397660][1]
> );[cfa066b73bf288dd][1]
> (EvaluationLink
> (DefinedPredicateNode"is_tall_B");[633392579119c32][1]
> (VariableNode"person");[40bf26ea112895be][1]
> );[c0a7dafcd6614da1][1]
> (EvaluationLink
> (DefinedPredicateNode"is_tall_B");[633392579119c32][1]
> (VariableNode"person");[40bf26ea112895be][1]
> );[c0a7dafcd6614da1][1]
> );[de1d20a71923fa1f][4]
> [2020-04-2716:50:34:315][DEBUG]SelectedBIT-node forexpansion:
> body:
> (EvaluationLink
> (DefinedPredicateNode"is_tall_B");[633392579119c32][1]
> (VariableNode"person");[40bf26ea112895be][1]
> );[c0a7dafcd6614da1][1]
> exhausted:0
> rules:
>   size =0
> [2020-04-2716:50:34:315][DEBUG]Novalid rule forthe selected
> BIT-node,abort expansion
> [2020-04-2716:50:34:315][DEBUG]Cannotfulfill an empty and-BIT.AbortBIT
> fulfillment
> [2020-04-2716:50:34:315][DEBUG]Iteration3/100
> [2020-04-2716:50:34:315][DEBUG]Weightedand-BITs:
> 1[de1d20a71923fa1f][4]
> [2020-04-2716:50:34:316][DEBUG]Selectedand-BIT forexpansion:
> (BindLink
> (TypedVariableLink
> (VariableNode"person");[40bf26ea112895be][1]
> (TypeNode"ConceptNode");[3494df0ad0397660][1]
> );[cfa066b73bf288dd][1]
> (EvaluationLink
> (DefinedPredicateNode"is_tall_B");[633392579119c32][1]
> (VariableNode"person");[40bf26ea112895be][1]
> );[c0a7dafcd6614da1][1]
> (EvaluationLink
> (DefinedPredicateNode"is_tall_B");[633392579119c32][1]
> (VariableNode"person");[40bf26ea112895be][1]
> );[c0a7dafcd6614da1][1]
> );[de1d20a71923fa1f][4]
> [2020-04-2716:50:34:316][DEBUG]AllBIT-nodes of thisand-BIT are exhausted
> (orpossibly fulfilled).Abortexpansion.
> [2020-04-2716:50:34:316][DEBUG]Cannotfulfill an empty and-BIT.AbortBIT
> fulfillment
> [2020-04-2716:50:34:316][DEBUG]Terminate:all AndBITSare exhausted
> [2020-04-2716:50:34:316][DEBUG]Finishedbackward chaining withresults:
> size =0
> TheBackwardChainertook 0.00
> |
>
>
>
> --
> 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+u...@googlegroups.com
> <mailto:opencog+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/ab61f7d9-6110-44fb-a661-d7784bd2ae5a%40googlegroups.com
> <https://groups.google.com/d/msgid/opencog/ab61f7d9-6110-44fb-a661-d7784bd2ae5a%40googlegroups.com?utm_medium=email&utm_source=footer>.

Alexander Gabriel

unread,
May 6, 2020, 6:31:05 AM5/6/20
to opencog
Am Dienstag, 5. Mai 2020 09:10:54 UTC+1 schrieb Nil:
Hi Alex, 

I think there is no reasoning needed here, a pattern matcher query would 
suffice, that is said it the BC should succeed at the first iteration. 

I see query_B is using DefinedPredicateNode("is_tall_B") while your 
DefineLink is using "tall_B" maybe that's the problem. 

Hi Nil,
no, sorry. That's a typo introduced while renaming things to make more sense in the example :/

Here is a cleaned up version of the full source and output (I'm aware there are no rules loaded, I just can't find a relevant one and I couldn't figure out how to load all the rules from python..or rather, I couldn't figure out how to tell the python chainer call to use the pln-created atomspace for the rules..(I don't know how to reference the correct atomspace from python)):

#!/usr/bin/env python


from opencog.type_constructors import *
from opencog.ure import BackwardChainer, ForwardChainer
from opencog.utilities import initialize_opencog
from opencog.atomspace import AtomSpace, TruthValue
from opencog.logger import log




def print_results(query,results):
   
print("Query:\n{:}\n\nResults:\n{:}\n\nDetails:\n--------".format(query, results))
   
if query.type_name == "GetLink":
       
for setlink in results.get_out():
           
for result in setlink.get_out():
               
print("Result Truth: {:}".format(result.tv))
               
print("Result:\n{:}".format(result))
               
print("------------------------\n")
   
elif query.type_name == "AndLink":
       
for result in results.get_out():
           
print("Result Truth: {:}".format(result.tv))
           
print("Result:\n{:}".format(result))
           
for condition in result.get_out():
               
print("------------------------")
               
print("Condition:{:}".format(condition))
               
print("Condition Truth: {:}".format(condition.tv))
               
if condition.type_name == "NotLink":
                    subcondition
= condition.get_out()[0]
                   
print("    Subcondition: {:}".format(subcondition))
                   
print("    Subcondition Truth: {:}".format(subcondition.tv))
           
print("-----------------------------------------------------")
   
else:
       
for result in results.get_out():
           
print("Result Truth: {:}".format(result.tv))
           
print("Result:\n{:}".format(result))
           
print("------------------------\n")




if __name__ == '__main__':

   
# I patched the URE logger to use the standard logger instance, you're unlikely to get ure debug ouptput if you run the code.
    log
.use_stdout()
    log
.set_level("DEBUG")


    atomspace
= AtomSpace()


    initialize_opencog
(atomspace)


    height
= PredicateNode("height")
    is_tall
= DefinedPredicateNode("is_tall_B")


    someone
= ConceptNode("bob").truth_value(1.0, 1.0)
    someone
.set_value(height, FloatValue(1.9))


    var_person
= VariableNode("person")
    var_x
= VariableNode("X")




   
DefineLink(
        is_tall
,
           
LambdaLink(
                var_x
,
                   
GreaterThanLink(
                       
ValueOfLink(
                            var_x
,
                            height
),
                       
NumberNode("1.75"))))


    variables
= VariableList(
       
TypedVariableLink(
            var_person
,
           
TypeNode("ConceptNode")))


    query
= EvaluationLink(
        is_tall
,
        var_person
)




    chainer
= BackwardChainer(_as=atomspace,
                      rbs
=ConceptNode("none"), trace_as=None, control_as=None, focus_set=None,
                      target
=query, vardecl=variables)
    chainer
.do_chain()
    results
= chainer.get_results()
    print_results
(query, results)



and the result of running it:

[2020-05-06 10:22:36:775] [DEBUG] initialize_opencog - initializing Python
[2020-05-06 10:22:36:775] [INFO] [global_python_initialize] Start
[2020-05-06 10:22:36:775] [INFO] [global_python_initialize] Adding OpenCog sys.path directories
[2020-05-06 10:22:36:775] [DEBUG] Python 'sys.path' is:
[2020-05-06 10:22:36:775] [DEBUG]      0 > /home/rasberry/git/ure/build/opencog/cython
[2020-05-06 10:22:36:775] [DEBUG]      1 > /home/rasberry/git/atomspace/build/opencog/cython
[2020-05-06 10:22:36:775] [DEBUG]      2 > /home/rasberry/catkin_ws/devel/lib/python2.7/dist-packages
[2020-05-06 10:22:36:775] [DEBUG]      3 > /opt/ros/kinetic/lib/python2.7/dist-packages
[2020-05-06 10:22:36:775] [DEBUG]      4 > /home/rasberry/catkin_ws/src/rasberry_hri/src
[2020-05-06 10:22:36:775] [DEBUG]      5 > /usr/local/lib/python2.7/dist-packages/webnsock-0.0.6-py2.7.egg
[2020-05-06 10:22:36:775] [DEBUG]      6 > /usr/local/lib/python2.7/dist-packages/web.py-0.40.dev1-py2.7.egg
[2020-05-06 10:22:36:775] [DEBUG]      7 > /usr/lib/python2.7/dist-packages
[2020-05-06 10:22:36:775] [DEBUG]      8 > /usr/local/lib/python2.7/dist-packages/pyproj-1.9.5.1-py2.7-linux-x86_64.egg
[2020-05-06 10:22:36:775] [DEBUG]      9 > /home/rasberry/git/ure/build/opencog/cython
[2020-05-06 10:22:36:775] [DEBUG]     10 > /home/rasberry/git/atomspace/build/opencog/cython
[2020-05-06 10:22:36:775] [DEBUG]     11 > /home/rasberry/catkin_ws/devel/lib/python2.7/dist-packages
[2020-05-06 10:22:36:775] [DEBUG]     12 > /opt/ros/kinetic/lib/python2.7/dist-packages
[2020-05-06 10:22:36:775] [DEBUG]     13 > /usr/lib/python2.7
[2020-05-06 10:22:36:775] [DEBUG]     14 > /usr/lib/python2.7/plat-x86_64-linux-gnu
[2020-05-06 10:22:36:775] [DEBUG]     15 > /usr/lib/python2.7/lib-tk
[2020-05-06 10:22:36:775] [DEBUG]     16 > /usr/lib/python2.7/lib-old
[2020-05-06 10:22:36:775] [DEBUG]     17 > /usr/lib/python2.7/lib-dynload
[2020-05-06 10:22:36:775] [DEBUG]     18 > /home/rasberry/.local/lib/python2.7/site-packages
[2020-05-06 10:22:36:775] [DEBUG]     19 > /usr/local/lib/python2.7/dist-packages
[2020-05-06 10:22:36:775] [DEBUG]     20 > /usr/lib/python2.7/dist-packages/PILcompat
[2020-05-06 10:22:36:775] [DEBUG]     21 > /usr/lib/python2.7/dist-packages/gtk-2.0
[2020-05-06 10:22:36:775] [DEBUG]     22 > /usr/lib/python2.7/dist-packages/wx-3.0-gtk2
[2020-05-06 10:22:36:775] [INFO] [global_python_initialize] Finish
[2020-05-06 10:22:36:775] [DEBUG] initialize_opencog - creating PythonEval singleton instance
[2020-05-06 10:22:36:775] [INFO] PythonEval::initialize_python_objects_and_imports Finished initialising python evaluator.
[2020-05-06 10:22:36:775] [DEBUG] Rule-base none, set parameter URE:maximum-iterations to 100 [default] 
[2020-05-06 10:22:36:775] [DEBUG] Rule-base none, set parameter URE:complexity-penalty to 0 [default] 
[2020-05-06 10:22:36:775] [DEBUG] Rule-base none, set parameter URE:jobs to 1 [default] 
[2020-05-06 10:22:36:775] [DEBUG] Rule-base none, set parameter URE:FC:retry-exhausted-sources to 0 [default] 
[2020-05-06 10:22:36:775] [DEBUG] Rule-base none, set parameter URE:FC:full-rule-application to 0 [default] 
[2020-05-06 10:22:36:776] [DEBUG] Rule-base none, set parameter URE:BC:maximum-bit-size to -1 [default] 
[2020-05-06 10:22:36:776] [DEBUG] Rule-base none, set parameter URE:BC:MM:complexity-penalty to 0 [default] 
[2020-05-06 10:22:36:776] [DEBUG] Rule-base none, set parameter URE:BC:MM:compressiveness to 1 [default] 
[2020-05-06 10:22:36:776] [DEBUG] Default inference rule TVs:
[2020-05-06 10:22:36:776] [DEBUG] Start backward chaining
[2020-05-06 10:22:36:776] [DEBUG] With rule set:
size = 0
[2020-05-06 10:22:36:776] [DEBUG] Iteration 1/100
[2020-05-06 10:22:36:776] [DEBUG] Initialize BIT with:
(BindLink
  (TypedVariableLink
    (VariableNode "person") ; [40bf26ea112895be][1]
    (TypeNode "ConceptNode") ; [3494df0ad0397660][1]
  ) ; [cfa066b73bf288dd][1]
  (EvaluationLink
    (DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
    (VariableNode "person") ; [40bf26ea112895be][1]
  ) ; [c0a7dafcd6614da1][1]
  (EvaluationLink
    (DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
    (VariableNode "person") ; [40bf26ea112895be][1]
  ) ; [c0a7dafcd6614da1][1]
) ; [de1d20a71923fa1f][3]
[2020-05-06 10:22:36:776] [DEBUG] Selected and-BIT for fulfillment (fcs value):
[de1d20a71923fa1f][3]
[2020-05-06 10:22:36:776] [DEBUG] Results:
size = 0
[2020-05-06 10:22:36:776] [DEBUG] Iteration 2/100
[2020-05-06 10:22:36:776] [DEBUG] Weighted and-BITs:
1 [de1d20a71923fa1f][3]
[2020-05-06 10:22:36:776] [DEBUG] Selected and-BIT for expansion:
(BindLink
  (TypedVariableLink
    (VariableNode "person") ; [40bf26ea112895be][1]
    (TypeNode "ConceptNode") ; [3494df0ad0397660][1]
  ) ; [cfa066b73bf288dd][1]
  (EvaluationLink
    (DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
    (VariableNode "person") ; [40bf26ea112895be][1]
  ) ; [c0a7dafcd6614da1][1]
  (EvaluationLink
    (DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
    (VariableNode "person") ; [40bf26ea112895be][1]
  ) ; [c0a7dafcd6614da1][1]
) ; [de1d20a71923fa1f][3]
[2020-05-06 10:22:36:776] [DEBUG] Selected BIT-node for expansion:
body:
  (EvaluationLink
    (DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
    (VariableNode "person") ; [40bf26ea112895be][1]
  ) ; [c0a7dafcd6614da1][1]
exhausted: 0
rules:
  size = 0
[2020-05-06 10:22:36:776] [DEBUG] No valid rule for the selected BIT-node, abort expansion
[2020-05-06 10:22:36:776] [DEBUG] Cannot fulfill an empty and-BIT. Abort BIT fulfillment
[2020-05-06 10:22:36:776] [DEBUG] Iteration 3/100
[2020-05-06 10:22:36:776] [DEBUG] Weighted and-BITs:
1 [de1d20a71923fa1f][3]
[2020-05-06 10:22:36:776] [DEBUG] Selected and-BIT for expansion:
(BindLink
  (TypedVariableLink
    (VariableNode "person") ; [40bf26ea112895be][1]
    (TypeNode "ConceptNode") ; [3494df0ad0397660][1]
  ) ; [cfa066b73bf288dd][1]
  (EvaluationLink
    (DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
    (VariableNode "person") ; [40bf26ea112895be][1]
  ) ; [c0a7dafcd6614da1][1]
  (EvaluationLink
    (DefinedPredicateNode "is_tall_B") ; [633392579119c32][1]
    (VariableNode "person") ; [40bf26ea112895be][1]
  ) ; [c0a7dafcd6614da1][1]
) ; [de1d20a71923fa1f][3]
[2020-05-06 10:22:36:776] [DEBUG] All BIT-nodes of this and-BIT are exhausted (or possibly fulfilled). Abort expansion.
[2020-05-06 10:22:36:776] [DEBUG] Cannot fulfill an empty and-BIT. Abort BIT fulfillment
[2020-05-06 10:22:36:776] [DEBUG] Terminate: all AndBITS are exhausted
[2020-05-06 10:22:36:776] [DEBUG] Finished backward chaining with results:
size = 0
Query:
(EvaluationLink (DefinedPredicateNode "is_tall_B") (VariableNode "person"))

Results:
(SetLink)

Details:
--------


Thank you for your time!

Best,
Alex

Nil Geisweiller

unread,
May 7, 2020, 6:56:37 AM5/7/20
to ope...@googlegroups.com
Hi Alex,

What do you get if you run the pattern matcher query

(GetLink
(TypedVariableLink
(VariableNode "person")
(TypeNode "ConceptNode")
)
(EvaluationLink
(DefinedPredicateNode "is_tall_B")
(VariableNode "person")
)
)

instead of calling the backward chainer?

On 5/6/20 1:31 PM, Alexander Gabriel wrote:
> # I patched the URE logger to use the standard logger instance, you're
> unlikely to get ure debug ouptput if you run the code.

Since you've managed to hack the ure logger, do you think you could add
python binding for it?

That would be really awesome. I would do it but I know nothing about
python bindings, I'm already overflown and don't use Python. A ure log
binding would allow me to more easily assist ure python users (and maybe
even switch to it, if mature enough).

Nil

Alexander Gabriel

unread,
May 19, 2020, 11:23:47 AM5/19/20
to opencog
Hi Nil,

Am Donnerstag, 7. Mai 2020 11:56:37 UTC+1 schrieb Nil:
Hi Alex,

What do you get if you run the pattern matcher query

(GetLink
   (TypedVariableLink
     (VariableNode "person")
     (TypeNode "ConceptNode")
   )
   (EvaluationLink
     (DefinedPredicateNode "is_tall_B")
     (VariableNode "person")
   )
)

instead of calling the backward chainer?

it worked in the pattern matcher.

 

On 5/6/20 1:31 PM, Alexander Gabriel wrote:
> # I patched the URE logger to use the standard logger instance, you're
> unlikely to get ure debug ouptput if you run the code.

Since you've managed to hack the ure logger, do you think you could add
python binding for it?

Well, it was a one line change that made the whole ure logger code irrelevant because it just returns the standard logger whenever a logger is called for. I didn't see a reason to have two loggers.
Regarding the python bindings, my knowledge regarding cython is really limited, but I guess you could just use the python logger code from the main project...I looked at it but didn't find the details of how it is used....and the debug output from that part of the code is quite limited (to scheme parsing as far as I can see).

Nil Geisweiller

unread,
May 20, 2020, 6:07:18 AM5/20/20
to ope...@googlegroups.com
Hi Alex,

On 5/19/20 6:23 PM, Alexander Gabriel wrote:
> Hi Nil,
>
> Am Donnerstag, 7. Mai 2020 11:56:37 UTC+1 schrieb Nil:
>
> Hi Alex,
>
> What do you get if you run the pattern matcher query
>
> (GetLink
>    (TypedVariableLink
>      (VariableNode "person")
>      (TypeNode "ConceptNode")
>    )
>    (EvaluationLink
>      (DefinedPredicateNode "is_tall_B")
>      (VariableNode "person")
>    )
> )
>
> instead of calling the backward chainer?
>
>
> it worked in the pattern matcher.

then something is odd with the URE.

>
>
> On 5/6/20 1:31 PM, Alexander Gabriel wrote:
> > # I patched the URE logger to use the standard logger instance,
> you're
> > unlikely to get ure debug ouptput if you run the code.
>
> Since you've managed to hack the ure logger, do you think you could add
> python binding for it?
>
>
> Well, it was a one line change that made the whole ure logger code
> irrelevant because it just returns the standard logger whenever a logger
> is called for. I didn't see a reason to have two loggers.

Under neath the loggers are the same, but they are
per-component-configurable. The point is to be able to set different log
levels and such, per component.

> Regarding the python bindings, my knowledge regarding cython is really
> limited, but I guess you could just use the python logger code from the
> main project...I looked at it but didn't find the details of how it is
> used....and the debug output from that part of the code is quite limited
> (to scheme parsing as far as I can see).

OK, thanks for at least trying. Hopefully someone else can take care of
it sooner than later.

In the meantime if I'd like to reproduce you problem I suppose need to
hack the ure logger to point to the main logger. It's not hard to do,
but in general I'd recommend that you push your hacks to branches, that
way you can point us to these branches and say "use this and that to
reproduce my problem".

Nil

>
>
> That would be really awesome. I would do it but I know nothing about
> python bindings, I'm already overflown and don't use Python. A ure log
> binding would allow me to more easily assist ure python users (and
> maybe
> even switch to it, if mature enough).
>
> Nil
>
> --
> 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+u...@googlegroups.com
> <mailto:opencog+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/79630365-1c38-4524-93d2-a5ca84d58279%40googlegroups.com
> <https://groups.google.com/d/msgid/opencog/79630365-1c38-4524-93d2-a5ca84d58279%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages