trace
domains
l = string*
predicates
repeat
start
breakQ(string,l,l)
rev(l,l,l)
find(l)
data(string,string,string)
clauses
data("how","you","i am finw,what about you").
data("what","do","lets play").
data("where","it","it is into the cupboard").
data("which","your","its mine").
repeat.
repeat:-
repeat.
start:-
repeat,
write("Ask Question::"),
readln(Que),
breakQ(Que,Old,Act_L),
rev(Act_L,[],Re),
find(Re).
breakQ(Que,Old,Act):-
Que<>"",
fronttoken(Que,Token,Rem),
New = [Token|Old],
breakQ(Rem,New,Act).
breakQ(Que,New,Act):-
Act = New.
rev([],R,R).
rev([Head|Act_L],R,T):-
rev(Act_L,[Head|R],T).
find([X,Y,Z|Tail]):-
data(X,Z,F),
write(F).