diff --git a/opencog/unify/Unify.cc b/opencog/unify/Unify.cc index 2bfe4e38af..256a3a479a 100644 --- a/opencog/unify/Unify.cc +++ b/opencog/unify/Unify.cc @@ -493,15 +493,22 @@ Handle Unify::substitute_vardecl(const Handle& vardecl, return createLink(std::move(oset), t); } - +// Return true iff the given handle is not in the given atomspace (if +// any). static bool not_in_atomspace(const Handle& handle, const AtomSpace* atomspace) { return nullptr != atomspace and nullptr == atomspace->get_atom(handle); } -// Is a clause constant, relative to some atomspace? -// Why would it matter whether or not it is in some atomspace? +// Return true iff the given clause is constant and is not in the +// given atomspace. A set of variables is provided to make the +// distinction between variables and variable interpreted as constants +// (they are constants is not in vars). Checking the present of the +// clause in the atomspace matters because we don't want to trigger a +// rule that will produce a term conditioned on the presence of a +// clause that was actually not in the atomspace (that would have been +// turned into a constant due to partial instantiation of a rule). static bool not_constant(const HandleSet& vars, const Handle& clause, const AtomSpace* as) diff --git a/opencog/ure/backwardchainer/BIT.cc b/opencog/ure/backwardchainer/BIT.cc index 604856dd0f..b6081f82bc 100644 --- a/opencog/ure/backwardchainer/BIT.cc +++ b/opencog/ure/backwardchainer/BIT.cc @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include "BIT.h" diff --git a/opencog/ure/backwardchainer/ControlPolicy.cc b/opencog/ure/backwardchainer/ControlPolicy.cc index d0414dd44a..ef4f348854 100644 --- a/opencog/ure/backwardchainer/ControlPolicy.cc +++ b/opencog/ure/backwardchainer/ControlPolicy.cc @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "../MixtureModel.h" #include "../ActionSelection.h" diff --git a/tests/ure/backwardchainer/BITUTest.cxxtest b/tests/ure/backwardchainer/BITUTest.cxxtest index 8c7f4a09f5..8bdcc66cd7 100644 --- a/tests/ure/backwardchainer/BITUTest.cxxtest +++ b/tests/ure/backwardchainer/BITUTest.cxxtest @@ -168,19 +168,6 @@ void BITUTest::test_expand_1() " (VariableSet" " )" " (AndLink" - " (PresentLink" - " (TypedVariableLink" - " (VariableNode \"$X\")" - " (TypeNode \"ConceptNode\")" - " )" - " (EvaluationLink" - " (PredicateNode \"contain\")" - " (ListLink" - " (ConceptNode \"treatment-1\")" - " (ConceptNode \"compound-A\")" - " )" - " )" - " )" " (NotLink" " (IdenticalLink" " (LambdaLink" diff --git a/tests/ure/backwardchainer/GradientUTest.cxxtest b/tests/ure/backwardchainer/GradientUTest.cxxtest index 62564ca365..337bf130a3 100644 --- a/tests/ure/backwardchainer/GradientUTest.cxxtest +++ b/tests/ure/backwardchainer/GradientUTest.cxxtest @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include