/*
 * Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package org.mandarax.kernel;


/**
 * Interface for abstract loop checkers. The inference engine passes a list of clauses
 * that have been applied recently, and the loop checker decides whether this is
 * an infinite loop or not. Implementing classes will not provide an algorithm
 * that is theoretically correct (the checked list is finite, and there are recursive computations
 * always applying the same rule that are longer than this list but terminate).
 * But for certain (non mathematical) domains this will provide a correct loop checking.
 * Therefor this is a typical 80/20 approach.
 * @todo: investigate whether we should take unifications made into account
 * @author <A HREF="mailto:mandarax@jbdietrich.com">Jens Dietrich</A>
 * @version 3.3.1 <9 August 2004>
 * @since 1.3
 */
public interface LoopCheckingAlgorithm {

    /**
     * Indicates whether the list of applied clauses represents an infinite loop.
     * @return a boolean
     * @param appliedClauses a list
     */
    boolean isInfiniteLoop(java.util.List appliedClauses);
}
