atomspace icon indicating copy to clipboard operation
atomspace copied to clipboard

LocalQuoteLink doesn't play well with alpha-conversion

Open ngeiswei opened this issue 9 years ago • 0 comments

First enter

(define g-1
(GetLink
   (TypedVariable
      (VariableNode "$V-1")
      (TypeNode "VariableNode"))
   (LocalQuoteLink
      (ImplicationScopeLink
         (VariableNode "$V-1")
         (EvaluationLink
            (PredicateNode "P")
            (VariableNode "$V-1"))
         (EvaluationLink
            (PredicateNode "Q")
            (VariableNode "$V-1"))))))

Then

(define g-2
(GetLink
   (VariableNode "$V-2")
   (LocalQuoteLink
      (ImplicationScopeLink
         (VariableNode "$V-2")
         (EvaluationLink
            (PredicateNode "P")
            (VariableNode "$V-2"))
         (EvaluationLink
            (PredicateNode "Q")
            (VariableNode "$V-2"))))))

First I get the following error

ERROR: In procedure cog-new-link:
ERROR: Throw to key `C++-EXCEPTION' with args `("cog-new-link" "The variable (VariableNode \"$V-2\") ; [5514869556520196688][0]\n does not appear (unquoted) in any clause! (/home/nilg/OpenCog/atomspace/opencog/atoms/pattern/PatternLink.cc:469)")'.

If I disable that check by applying commit https://github.com/ngeiswei/atomspace/commit/2dde6b8119bb59a3d0e9914c45dc89653eed2d84 then for g-2 I get

(GetLink
   (VariableNode "$V-2")
   (LocalQuoteLink
      (ImplicationScopeLink
         (VariableNode "$V-1")
         (EvaluationLink
            (PredicateNode "P")
            (VariableNode "$V-1")
         )
         (EvaluationLink
            (PredicateNode "Q")
            (VariableNode "$V-1")
         )
      )
   )
)

which is obviously wrong.

ngeiswei avatar Dec 05 '16 09:12 ngeiswei