Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SuReal not handling Predicate without ListLink wrapping argument #3497

Open
eddiemonroe opened this issue May 21, 2019 · 1 comment
Open
Labels

Comments

@eddiemonroe
Copy link
Member

My understanding is that Predicates with single arguments do not need a ListLink to wrap the argument, e.g.,

Evaluation
  Predicate "pred"
  Concept "argument"

If that is not correct, and the above is not a valid form, then this is not a bug and I take it back.

Otherwise, an Evaluation in the form above does not return a result in SuReal, while the same Evaluation with a List wrapping the argument does return a result.

This will reproduce the alleged bug:

(use-modules
  (opencog)
  (opencog exec)
  (opencog nlp)
  (opencog nlp chatbot)
  (opencog nlp relex2logic)
  (opencog nlp sureal))

(define with-list
  (EvaluationLink
     (PredicateNode "entertained")
     (ListLink
        (ConceptNode "you"))))

(define no-list
  (EvaluationLink
    (PredicateNode "entertained")
    (ConceptNode "you")))

(define (sureal-for-logic logic)
  (sureal
    (Set
      logic
      (Inheritance
        (InterpretationNode "blah")
        (DefinedLinguisticConcept "TruthQuerySpeechAct")))))

; pre-parse for sureal sentance generation 
(nlp-parse "Were you entertained?")

(format #t "\nWith List result:\n~a\n" (sureal-for-logic with-list))
(format #t "\nNo List result:\n~a\n\n" (sureal-for-logic no-list))

Results:

With List result:
((were you entertained ?))

No List result:
()
@leungmanhin
Copy link
Contributor

Yes I think this is more about pattern matching, with-list and no-list are syntactically two different graphs after all, so the pattern matcher will not return the with-list one if the query has no list, and vice versa, e.g.

(use-modules
  (opencog)
  (opencog exec))

(EvaluationLink
  (PredicateNode "entertained")
  (ListLink
    (ConceptNode "you")))

(EvaluationLink
  (PredicateNode "entertained")
  (ConceptNode "they"))


(define with-list-query
  (GetLink
    (TypedVariableLink
      (VariableNode "$x")
      (TypeNode "ConceptNode"))
  (EvaluationLink
    (PredicateNode "entertained")
    (ListLink
      (VariableNode "$x")))))

(define no-list-query
  (GetLink
    (TypedVariableLink
      (VariableNode "$y")
      (TypeNode "ConceptNode"))
  (EvaluationLink
    (PredicateNode "entertained")
    (VariableNode "$y"))))


(format #t "\nWith List result:\n~a\n" (cog-execute! with-list-query))
(format #t "\nNo List result:\n~a\n\n" (cog-execute! no-list-query))

But I think this would not be a big problem since the current NLP pipeline generates a ListLink to wrap those arguments for every EvaluationLink, or maybe not?

@linas linas added the nlp label Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants