Question: prolog programming % Problem 5 (Recursion with read-write loop) f Implement a predicate, chat, that replies like a simple chatbot % to a word the

prolog programming prolog programming % Problem 5 (Recursion with read-write loop) f Implement a

% Problem 5 (Recursion with read-write loop) f Implement a predicate, chat, that replies like a simple chatbot % to a word the user types in, & stops when the user types stop. % See the sample dialog below. You can invent your own chatbot % replies, but they should incorporate the user's word. % Implement the interactive loop using recursion. !! % Sample dialog: $ ?- chat. & hello I am a chatbot $ when you see "user:" type a word followed by % or type "stop." if you want to stop this nonsense! % user: hello. % Who likes hello? % user: everyone. % What is everyone? % user: nothing. % Do you like nothing? % user: yes. % Could you please stop talking about yes? % user: ok. & Could you please stop talking about ok? % user: stop. % true. & Write your solution here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!