{"action":"created","issue":{"url":"https://api.github.com/repos/opencog/atomspace/issues/490","labels_url":"https://api.github.com/repos/opencog/atomspace/issues/490/labels{/name}","comments_url":"https://api.github.com/repos/opencog/atomspace/issues/490/comments","events_url":"https://api.github.com/repos/opencog/atomspace/issues/490/events","html_url":"https://github.com/opencog/atomspace/issues/490","id":117326323,"number":490,"title":"Can't tell the PM to set a connector as not evaluatable","user":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars.githubusercontent.com/u/819225?v=3","gravatar_id":"","url":"https://api.github.com/users/ngeiswei","html_url":"https://github.com/ngeiswei","followers_url":"https://api.github.com/users/ngeiswei/followers","following_url":"https://api.github.com/users/ngeiswei/following{/other_user}","gists_url":"https://api.github.com/users/ngeiswei/gists{/gist_id}","starred_url":"https://api.github.com/users/ngeiswei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngeiswei/subscriptions","organizations_url":"https://api.github.com/users/ngeiswei/orgs","repos_url":"https://api.github.com/users/ngeiswei/repos","events_url":"https://api.github.com/users/ngeiswei/events{/privacy}","received_events_url":"https://api.github.com/users/ngeiswei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-17T10:34:32Z","updated_at":"2015-11-17T11:02:52Z","closed_at":null,"body":"Let's add the following\r\n\r\n```scheme\r\nscheme@(guile-user)> (And (Concept \"A\") (Concept \"B\")) \r\nscheme@(guile-user)> (define x (Variable \"$X\"))\r\nscheme@(guile-user)> (define y (Variable \"$Y\"))\r\nscheme@(guile-user)> (define concept-type (Type \"ConceptNode\"))\r\nscheme@(guile-user)> (define var-decl (VariableList (TypedVariable x concept-type) (TypedVariable y concept-type)))\r\nscheme@(guile-user)> (define body (AndLink x y))\r\nscheme@(guile-user)> (define pat (GetLink var-decl (AndLink body)))\r\n```\r\n\r\nNow let's try to match it\r\n\r\n```scheme\r\nscheme@(guile-user)> (cog-satisfying-set pat)\r\n$5 = (SetLink\r\n)\r\n```\r\n\r\nIt should match A and B as groundings for x and y, not the empty set.\r\n\r\nI found that the problem comes from PatternLink::trace_connectives that wrongly infers that (AndLink x y) is evaluatable. This is of course wrong given the type of the variables x and y which are ConceptNode. If I disable the trace_connectives call it works as expected.\r\n\r\nI thought using QuoteLink and UnquoteLink might work but apparently not, as you may see:\r\n\r\n```scheme\r\nscheme@(guile-user)> (define q-body (QuoteLink (AndLink (UnquoteLink x) (UnquoteLink y))))\r\nscheme@(guile-user)> (define q-pat (GetLink var-decl (AndLink q-body)))\r\nERROR: In procedure cog-new-link:\r\nERROR: Throw to key `C++-EXCEPTION' with args `(\"cog-new-link\" \"The variable (VariableNode \\\"$X\\\") ; [5][1]\\n does not appear (unquoted) in any clause! (/home/nilg/OpenCog/atomspace/opencog/atoms/pattern/PatternLink.cc:474)\")'.\r\n\r\nEntering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.\r\n```\r\n\r\nI see 2 ways to fix this bug:\r\n1. Fix QuoteLink/UnquoteLink (I think I recall that UnquoteLink isn't yet supported). Alternatively one might implement LocalQuoteLink.\r\n2. Make evaluatable on the connectors more correct.\r\n\r\nI'm not sure yet what would be the right way to go, I guess both fixes are useful in the long-run. I'll probably pick up the one which I find easier."},"comment":{"url":"https://api.github.com/repos/opencog/atomspace/issues/comments/157338282","html_url":"https://github.com/opencog/atomspace/issues/490#issuecomment-157338282","issue_url":"https://api.github.com/repos/opencog/atomspace/issues/490","id":157338282,"user":{"login":"linas","id":94368,"avatar_url":"https://avatars.githubusercontent.com/u/94368?v=3","gravatar_id":"","url":"https://api.github.com/users/linas","html_url":"https://github.com/linas","followers_url":"https://api.github.com/users/linas/followers","following_url":"https://api.github.com/users/linas/following{/other_user}","gists_url":"https://api.github.com/users/linas/gists{/gist_id}","starred_url":"https://api.github.com/users/linas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linas/subscriptions","organizations_url":"https://api.github.com/users/linas/orgs","repos_url":"https://api.github.com/users/linas/repos","events_url":"https://api.github.com/users/linas/events{/privacy}","received_events_url":"https://api.github.com/users/linas/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T11:02:52Z","updated_at":"2015-11-17T11:02:52Z","body":"I don't like LocalQuote because it introduces new weird semantics (that frankly, I never understood) -- whereas most or all functional programming languages already have quotes that are well-defined, that people are already familiar with. So I was suggesting just sticking with the well-known variant."}}