getTail() public method

public getTail ( ) : List
return List
Esempio n. 1
0
        // Returns c if no dropping occurred
        private Chain tryDropping(Chain c)
        {
            Literal head = c.getHead();
            if (null != head && (head is ReducedLiteral))
            {
                Chain dropped = new Chain(c.getTail());
                dropped.setProofStep(new ProofStepChainDropped(dropped, c));
                return dropped;
            }

            return c;
        }
Esempio n. 2
0
 // Returns c if no cancellation occurred
 private Chain tryCancellation(Chain c)
 {
     Literal head = c.getHead();
     if (null != head && !(head is ReducedLiteral))
     {
         foreach (Literal l in c.getTail())
         {
             if (l is ReducedLiteral)
             {
                 // if they can be resolved
                 if (head.isNegativeLiteral() != l.isNegativeLiteral())
                 {
                     Dictionary<Variable, Term> subst = unifier.unify(head
                             .getAtomicSentence(), l.getAtomicSentence());
                     if (null != subst)
                     {
                         // I have a cancellation
                         // Need to apply subst to all of the
                         // literals in the cancellation
                         List<Literal> cancLits = new List<Literal>();
                         foreach (Literal lfc in c.getTail())
                         {
                             AtomicSentence a = (AtomicSentence)substVisitor
                                     .subst(subst, lfc.getAtomicSentence());
                             cancLits.Add(lfc.newInstance(a));
                         }
                         Chain cancellation = new Chain(cancLits);
                         cancellation
                                 .setProofStep(new ProofStepChainCancellation(
                                         cancellation, c, subst));
                         return cancellation;
                     }
                 }
             }
         }
     }
     return c;
 }