AIMA.Core.Logic.FOL.Inference.FOLOTTERLikeTheoremProver.process C# (CSharp) Метод

process() приватный Метод

private process ( OTTERAnswerHandler ansHandler, IndexedClauses idxdClauses, List clauses, List sos, List usable ) : void
ansHandler OTTERAnswerHandler
idxdClauses IndexedClauses
clauses List
sos List
usable List
Результат void
        private void process(OTTERAnswerHandler ansHandler,
                IndexedClauses idxdClauses, List<Clause> clauses, List<Clause> sos,
                List<Clause> usable)
        {

            // * for each clause in clauses do
            foreach (Clause clause in clauses)
            {
                // * clause <- SIMPLIFY(clause)
                Clause clause2 = getClauseSimplifier().simplify(clause);

                // * merge identical literals
                // Note: Not required as handled by Clause Implementation
                // which keeps literals within a Set, so no duplicates
                // will exist.

                // * discard clause if it is a tautology
                if (clause2.isTautology())
                {
                    continue;
                }

                // * if clause has no literals then a refutation has been found
                // or if it just contains the answer literal.
                if (!ansHandler.isAnswer(clause2))
                {
                    // * sos <- [clause | sos]
                    // This check ensure duplicate clauses are not
                    // introduced which will cause the
                    // LightestClauseHeuristic to loop continuously
                    // on the same pair of objects.
                    if (!sos.Contains(clause2) && !usable.Contains(clause2))
                    {
                        foreach (Clause ac in clause2.getFactors())
                        {
                            if (!sos.Contains(ac) && !usable.Contains(ac))
                            {
                                idxdClauses.addClause(ac, sos, usable);

                                // * if clause has one literal then look for unit
                                // refutation
                                lookForUnitRefutation(ansHandler, idxdClauses, ac,
                                        sos, usable);
                            }
                        }
                    }
                }

                if (ansHandler.isComplete())
                {
                    break;
                }
            }
        }