hello, i have to write a programm in Prolog, it sounds very easy but it doesn't:
it shall implemente the semantic of have, give and sell...for..
the user can type: helen has a car. helen give tim a car...etc and the programm should save these information in the database.
and the user should be able to ask questions in two ways:who has and what does sb has like who has a car? what does helen have. was does tim have..etc and the answer should be right. similar for :helen sell tim a car for 1000 dollar.
I have written the programm this way: at first read input, turn a sentence into a list, save in database.( assert(database(Sentence)).but it just works for "have", not "give" and "sell".
i can not delete the information which is not correct after the user gives new sentence, in my example i have to add tim has a car and delete helen has a car after the user the 2nd sentence types.
please give me some suggestions.
it shall implemente the semantic of have, give and sell...for..
the user can type: helen has a car. helen give tim a car...etc and the programm should save these information in the database.
and the user should be able to ask questions in two ways:who has and what does sb has like who has a car? what does helen have. was does tim have..etc and the answer should be right. similar for :helen sell tim a car for 1000 dollar.
I have written the programm this way: at first read input, turn a sentence into a list, save in database.( assert(database(Sentence)).but it just works for "have", not "give" and "sell".
i can not delete the information which is not correct after the user gives new sentence, in my example i have to add tim has a car and delete helen has a car after the user the 2nd sentence types.
please give me some suggestions.