Hello i was wondering if any one would know how to queriy this program its a best first search thanks
slove_best([state(State,Path,Value)|Frontier],History,Moves) :-
final_state(State), reverse(Path,[],Moves).
slove_best([state(State,Path,Value)|Frontier],History,FinalPath) :-
setof(M,move(State,M),Moves),
update_fontier(Moves,State,Path,History,Frontier,Frontier1),
solve_best(Frontier1,[State|History],FinalPath).
update_Frontier([M|Ms],State,Path,History,F,F1) :-
update(State,M,State1),
legal(State1),
Value(State1,Value),
not member(State1,History),
insert((State1,[M|Path],Value),F,F0),
update_frontier(Ms,State,Ptha,History,F0,F1).
update_frontier([],S,P,H,F,F).
inserts([Value|Values],Frontier,Frontier1) :-
insert(Value,Frontier,Frontier0),
inserts(Values,Frontier0,Frontier1).
inserts([],Frontier,Frontier).
insert(State,[],[State]).
insert(State,[State1|States],[State,State1|States]) :-
less_than(State1,State).
insert(State,[State1|States],[State|States]) :-
equals(State,State1).
insert(State,[State1|States],[State1|States1]) :-
less_than(State,State1), insert(State,States,States1).
equals(state(S,P,V),state(S,P1,V)).
less_than(state(S1,P1,V1),state(S2,P2,V2)) :- S1=\=S2, V1<V2.
i also have another file here it is
initial_state(tree,a). value(a,0). final_state(j).
move(a,b). value(b,1). move(c,g). value(g,6).
move(a,c). value(c,5). move(d,j). value(j,9).
move(a,d). value(d,7). move(e,k). value(k,1).
move(a,e). value(e,2). move(f,h). value(h,3).
move(c,f). value(f,4). move(f,i). value(i,2).
slove_best([state(State,Path,Value)|Frontier],History,Moves) :-
final_state(State), reverse(Path,[],Moves).
slove_best([state(State,Path,Value)|Frontier],History,FinalPath) :-
setof(M,move(State,M),Moves),
update_fontier(Moves,State,Path,History,Frontier,Frontier1),
solve_best(Frontier1,[State|History],FinalPath).
update_Frontier([M|Ms],State,Path,History,F,F1) :-
update(State,M,State1),
legal(State1),
Value(State1,Value),
not member(State1,History),
insert((State1,[M|Path],Value),F,F0),
update_frontier(Ms,State,Ptha,History,F0,F1).
update_frontier([],S,P,H,F,F).
inserts([Value|Values],Frontier,Frontier1) :-
insert(Value,Frontier,Frontier0),
inserts(Values,Frontier0,Frontier1).
inserts([],Frontier,Frontier).
insert(State,[],[State]).
insert(State,[State1|States],[State,State1|States]) :-
less_than(State1,State).
insert(State,[State1|States],[State|States]) :-
equals(State,State1).
insert(State,[State1|States],[State1|States1]) :-
less_than(State,State1), insert(State,States,States1).
equals(state(S,P,V),state(S,P1,V)).
less_than(state(S1,P1,V1),state(S2,P2,V2)) :- S1=\=S2, V1<V2.
i also have another file here it is
initial_state(tree,a). value(a,0). final_state(j).
move(a,b). value(b,1). move(c,g). value(g,6).
move(a,c). value(c,5). move(d,j). value(j,9).
move(a,d). value(d,7). move(e,k). value(k,1).
move(a,e). value(e,2). move(f,h). value(h,3).
move(c,f). value(f,4). move(f,i). value(i,2).