[SOLVED] :- dynamic at/3, hasLander/3,fullStore/2,hasAnalysis/4.

$25

File Name: :-_dynamic_at/3,_hasLander/3,fullStore/2,hasAnalysis/4..zip
File Size: 518.1 KB

5/5 - (1 vote)

:- dynamic at/3, hasLander/3,fullStore/2,hasAnalysis/4.
/* This is necessary if rules with the predicate at(R,L,S) in the head are
not consecutive in your program. Eachnon-consecutive predicate
should be declared as dynamic.

Copyright By Assignmentchef assignmentchef

solve_problem(N,L) :- C0 is cputime,
max_length(L,N),
reachable(S,L), goal_state(S),
Cf is cputime, D is Cf C0, nl,
write(Elapsed time (sec): ), write(D), nl.
max_length([],N) :- N >= 0.
max_length([_|L],N1) :- N1 > 0, N is N1 -1, max_length(L,N).
reachable(S,[]) :- initial_state(S).
/* This recursive rule is for the regular part of the assignment */
reachable(S2, [M|List]) :- reachable(S1,List),
legal_move(S2,M,S1).

/* The following rule is for the bonus question only: remove comments
and write your own rules to implement the predicate useless(Action,List).
% reachable(S2, [M | ListOfActions]) :- reachable(S1,ListOfActions),
% legal_move(S2,M,S1),
% not useless(M,ListOfActions).

legal_move([A|S], A, S) :- poss(A,S).
initial_state([]).

/************ Precondition axioms ****************/
% Write your precondition rules here: write also brief comments.
% Read the assignment, Part 2 for detailed explanations.

/*********** Successor state axioms **************/
% Write your rules here: write also brief comments.
% Read the assignment, Part 2 for detailed explanations.

:- [initRovers].
/* This is to compile also the file initRovers.plbefore you
run a query. Do NOT insert this file here because your program
will be tested using different initial and goal states.*/

/**/
% If you would like to work on a bonus question, write below your rules that
% implement the predicate useles(Action,History). Read the Bonus part for details.

CS: assignmentchef QQ: 1823890830 Email: [email protected]

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] :- dynamic at/3, hasLander/3,fullStore/2,hasAnalysis/4.
$25