/* INVOCA : Invocation routines

                                                UTILITY
                                                Lawrence
                                                Updated: 11 September 81
*/

        %%%  INVOCA requires no other modules



  &(A,B) :- !, A, B.


  \\(A,B) :- A, ! ; B, !.



  any([]) :- !, fail.

  any([L|Rest]) :- L.

  any([L|Rest]) :- !, any(Rest).



                        % Findall X's such that P.
                         %  This is the (usual) hacked up version which
                         %  does not have a valid logical semantics when used
                         %  used with unbound free variables (so DONT!).

findall(X,P,List) :- bagof(X,P,List).            % Use bagof

  for(0,L) :- !.

  for(N,L) :- N > 0,
              L,
              N2 is N-1,
              for(N2,L),
              !.



  forall(A,C)
        :- A,
           not(C),
           !,
           fail.

  forall(_,_) :- !.



  nobt(X) :- X, !.



