sintaxis de base de conocimiento

19 views
Skip to first unread message

Rafaela Mazalu

unread,
Feb 4, 2015, 11:53:19 AM2/4/15
to spade...@googlegroups.com, Jerónimo Perfumo

Hola, tengo una duda con el uso de SPADE, al cargar una base de conocimiento (adjunto la parte del còdigo que me trae problemas). En la lìnea marcada en negrita se tilda el programa, es decir no continúa ni genera un error.
Tengo la sospecha de que a la coma no la está tomando correctamente. ¿Alguien tiene una idea de cual puede ser el problema?
Saludos.

    Jerónimo          




                self.myAgent.configureKB("SWI", None, "swipl")
                self.myAgent.addBelieve( 'nivel(0)' )
                self.myAgent.addBelieve( 'nivel(1)' )
                self.myAgent.addBelieve( 'nivel(2)' )
                self.myAgent.addBelieve( 'nivel(7)' )
                self.myAgent.addBelieve( 'nivelYAnteriores(0)' )
                self.myAgent.addBelieve( 'nivelYAnteriores(1) :- nivel(1), nivel(0)' )
                print("Hasta aca OK..001")
               
                #self.myAgent.addBelieve( 'NivelYAnteriores(X) :- nivel(X), X>1, Y is X-1, NivelYAnteriores(Y)' )
                print("Hasta aca OK..002")
               
                resultado =  self.myAgent.askBelieve( 'nivelYAnteriores(1)' )

Markus Schatten

unread,
Feb 4, 2015, 5:44:36 PM2/4/15
to spade...@googlegroups.com
Hola Rafaela,

I do not speak Spanish, but google translate helped me understand your
problem. Since you are trying to add a rule to your knowledge base,
you should use extra parenthesis, e.g.:

self.myAgent.addBelieve( '(nivelYAnteriores(1) :- nivel(1), nivel(0))' )

Hope this helps!

All the best,

M.
--
Markus Schatten, PhD
Assistant professor and head of Artificial Intelligence Lab
University of Zagreb
Faculty of Organization and Informatics
Pavlinska 2, 42000 Varazdin, Croatia
http://www.foi.hr/nastavnici/schatten.markus/index.html
http://www.researchgate.net/profile/Markus_Schatten1
http://ai.foi.hr
> --
> You received this message because you are subscribed to the Google Groups
> "spade-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to spade-users...@googlegroups.com.
> To post to this group, send email to spade...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages