
Prolog subclass: #Planner
  instanceVariableNames: ''
  classVariableNames: ''
  poolDictionaries: '' !

!Planner class logicMethods ! !


!Planner logicMethods !

append([],l,l).
append([h|t],l2,[h|l3]) :- append(t,l2,l3).!

collectFound(s,l) :- getnext(x),!!,
                collectFound([x|s],l).
collectFound(l,l).!

findall(x,goal,_) :- database( found()),
                     asserta( found(#mark)),
                     call( goal),
                     asserta( found(x)),
                     fail().
findall(_,_,list ) :- collectFound([],m),
                    !!,eq(list, m).!

getnext(x) :- retract( found(x)),!!,
              notEquiv(x,#mark).!

"last-method inheritance test case"
last( x,[x]).
last( x,[_|y]) :- last( x,y).!

length( [],0).
length([h|t], len) :- length( t, len0),
                   is( len, len0 value + 1).!

"Succeed if the first argument is a
 member of a List in the second argument."
member(x,[x|_]).
member(x,[_|t]) :- member (x,t).! !
