Ejemplo n.º 1
0
 @Override
 public List copy(Map<Variable, Variable> sharedVariables) {
   if (immutable) {
     return this;
   } else {
     Term newHead = head.copy(sharedVariables);
     Term newTail = tail.copy(sharedVariables);
     if (newHead == head && newTail == tail) {
       return this;
     } else {
       return new List(newHead, newTail, newHead.isImmutable() && newTail.isImmutable());
     }
   }
 }
Ejemplo n.º 2
0
 @Override
 public List getTerm() {
   if (immutable) {
     return this;
   } else {
     Term newHead = head.getTerm();
     Term newTail = tail.getTerm();
     if (newHead == head && newTail == tail) {
       return this;
     } else {
       return new List(newHead, newTail, newHead.isImmutable() && newTail.isImmutable());
     }
   }
 }