Prolog planning using retract and assert
I wonder, is it possible to do planning in Prolog using the knowledge base modified by retract and assert during the runtime? My idea is as follows: assume that I need to replace a flat tire of a car. I can either put something on the ground or move something from the ground to some free place. So I came up with such a code: at(flat, axle). at(spare, trunk). free(Where) :- at(_, Where), !, fail. remove(What) :- at(What, _), retract(at(What, _)), assert(at(What, ground)). put_on(What, Where) :- at(What, _), free(Where), retract(at(What, _)), assert(at(What, Where)). (I am a rookie in Prolog so