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

GetLink + ChoiceLink how to use? #326

Closed
amebel opened this issue Sep 22, 2015 · 4 comments
Closed

GetLink + ChoiceLink how to use? #326

amebel opened this issue Sep 22, 2015 · 4 comments

Comments

@amebel
Copy link
Contributor

amebel commented Sep 22, 2015

My Intention was to use ChoiceLink to get either of the EvaluationLinks, if they are present in the atomspace. also tried

  • (ChoiceLink (PresentLink (EvaluationLink ...)))
  • (OrLink (PresentLink (EvaluationLink ...))) ; just in case, was expecting an error

both also gave empty SetLink

Expected result

(SetLink
    (Node "OpenPsi: Energy-rule-xej90")
    (Node "OpenPsi: Energy-rule-pG1ez")
)

Content of the atomspace

 (EvaluationLink
   (PredicateNode "OpenPsi:Decrease")
   (ListLink
      (Node "OpenPsi: Energy-rule-xej90")
      (ConceptNode "OpenPsi:Energy")
   )
)
(EvaluationLink
   (PredicateNode "OpenPsi:Increase")
   (ListLink
      (Node "OpenPsi: Energy-rule-pG1ez")
      (ConceptNode "OpenPsi:Energy")
   )
)

Commands run

guile> (define get-nodes1
    (GetLink
       (TypedVariableLink
          (VariableNode "x")
          (TypeNode "Node")
       )
       (ChoiceLink
          (EvaluationLink
             (PredicateNode "OpenPsi:Increase")
             (ListLink
                (VariableNode "x")
                (ConceptNode "OpenPsi:Energy")
             )
          )
          (EvaluationLink
             (PredicateNode "OpenPsi:Decrease")
             (ListLink
                (VariableNode "x")
                (ConceptNode "OpenPsi:Energy")
             )
          )
       )
    )
)

guile> (cog-execute! get-nodes1)                                   
(SetLink                                                          
)                                                                 
@linas
Copy link
Member

linas commented Sep 22, 2015

Strange; that should work. It works if you skip the variable declaration.

@linas
Copy link
Member

linas commented Sep 22, 2015

Yeah, I see the problem. Working on it.

@linas linas added bug and removed question labels Sep 22, 2015
@linas linas self-assigned this Sep 22, 2015
@linas
Copy link
Member

linas commented Sep 23, 2015

Fixed in pul req #327

@linas linas closed this as completed Sep 23, 2015
@amebel
Copy link
Contributor Author

amebel commented Sep 24, 2015

thanks for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants