Block world problem in prolog12/31/2022 ![]() ![]() %%% to produce commercial quality computer programs. %%% them for specific educational purposes, and have made no effort %%% their correctness, reliability, or any other property. ![]() %%% Disclaimer: These programs are provided with no warranty whatsoever as to %%% We offer them for use, free of charge, for educational purposes only. Davis These programs are copyrighted by Benjamin/Cummings Publishers. %%% Structures and strategies for complex problem solving %%% This is one of the example programs from the textbook: Using the example code from "Artificial Intelligence - Structures and Strategies for Complex Problem Solving" by George F Luger ( WorldCat) So the question: can such an approach be used and if so, how? #Block world problem in prolog how to#Similarly, I can put a thing X to location Y if X is somewhere and Y is free and to do so, I remove X from where it is and add the fact that X is at Y.Īnd now I am stuck: I have no idea how to use this code now, since at(spare, axle) just says nope, even with tracing. I can remove a thing X if X is somewhere and to remove it, I remove the fact specifying where it is and add a fact that it is on the ground. The idea is: I have a flat tire on the axle and a spare one in the trunk. (I am a rookie in Prolog so maybe that it is even wrong, if so, please advise me how to correct it.) Put_on(What, Where) :- at(What, _), free(Where), retract(at(What, _)), assert(at(What, Where)). Remove(What) :- at(What, _), retract(at(What, _)), assert(at(What, ground)). So I came up with such a code: at(flat, axle). I can either put something on the ground or move something from the ground to some free place. My idea is as follows: assume that I need to replace a flat tire of a car. I wonder, is it possible to do planning in Prolog using the knowledge base modified by retract and assert during the runtime? ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |