Nat res = null; while(res != R) { res = (Nat) replace.apply(R); R = res; }  if (unmake(R) != r) { System.err.println("unexpected result of computation!"); System.exit (1); }  }
int n = 17; int r = fib(n); Nat N = make(n); Nat R = factory.makeNat_Fib(N);  Nat res = null; while (res != R) { res = (Nat) replace.apply(R); R = res; }  if (unmake(R) != r) { System.err.println("unexpected result of computation!"); System.exit(1); }  }
  public void run2() {    GenericTraversal traversal = new GenericTraversal();    Replace replace = new Replace() {        public ATerm apply(ATerm atermSubject) {          Nat subject = (Nat) atermSubject;          if(subject.isPlus()) {            Nat arg1 = subject.getArg1();            Nat arg2 = subject.getArg2();            if(arg2.isZero()) {              return arg1;            } else if(arg2.isSuc()) {              Nat y = arg2.getPred();              return factory.makeNat_Suc(factory.makeNat_Plus(arg1,y));            }          } else if(subject.isFib()) {            Nat t = subject.getArg1();            if(t.isZero()) {              return factory.makeNat_Suc(t);            } else if (t.isSuc() && t.getPred().isZero()) {              return t.getPred();            } else {              Nat pred1 = t.getPred();              Nat pred2 = pred1.getPred();              return factory.makeNat_Plus(                factory.makeNat_Fib(pred2),                factory.makeNat_Fib(pred1));            }          }          return null;        }      };	        int n = 17;    int r = fib(n);    Nat N = make(n);    Nat R = factory.makeNat_Fib(N);    Nat res = null;    while(res != R) {      res = (Nat) replace.apply(R);      R = res;    }        if (unmake(R) != r) {      System.err.println("unexpected result of computation!");      System.exit (1);    }        }