I am trying to create a chatbot (as an assignment) in the prolog, so far I have created a database in a .pl file, and I have listed a lot of possible conversations. I know that the prologue works like this, for example, if we have
Chatbot(good)
and type
?-Chatbot(good).
he will answer
yes or ture.
Now I don’t know how to use my database so that the program can work exactly like chatbot, for example, without having to write in the appropriate syntax:
Hello (typed by the user)
Hi there, (typed by the program automatically)
My database is as follows:
answer( question, [
[Yes, I am here]]).
question ([are you there?])
source
share