I am trying to use this Planner https://www.cs.unm.edu/~luger/ai-final/code/PROLOG.planner.html .
I want to search a space with a numerical value. Below you can see my implementation of sum that is tested and seems to work. Then there are my two moves, plus and minus, where I delete the value(X)
and add value(Y)
where Y
is X +- 1
respectively.
If I now consult the planner (last statement with go), I do not get the expected result of plus()
but instead false
as the planner does not find a way from value(2)
to value(3)
.
sum(X,Y,Z) :- Z is X+Y.
move(plus(), [value(X)], [del(value(X)), sum(X,1,Y) , add(value(Y))]).
move(minus(), [value(X)], [del(value(X)), sum(X,-1,Y) , add(value(Y))]).
go([value(2)], [value(3)]).