public static double activateCachedNetwork(Cons tree) {
    { Vector scores = Vector.newVector(tree.length());
      double score = 0.0;
      double sum = 0.0;

      { Cons cachedNet = null;
        Cons iter000 = tree;
        int k = Stella.NULL_INTEGER;
        int iter001 = 0;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest, iter001 = iter001 + 1) {
          cachedNet = ((Cons)(iter000.value));
          k = iter001;
          { PropositionNeuralNetwork net = ((PropositionNeuralNetwork)(cachedNet.value));

            sum = 0.0;
            score = 0.0;
            (net.input.theArray)[0] = (FloatWrapper.wrapFloat(1.0));
            { int i = Stella.NULL_INTEGER;
              int iter002 = 1;
              int upperBound000 = net.input.length() - 1;
              Stella_Object input = null;
              Cons iter003 = cachedNet.rest;

              for (;(iter002 <= upperBound000) &&
                        (!(iter003 == Stella.NIL)); iter002 = iter002 + 1, iter003 = iter003.rest) {
                i = iter002;
                input = iter003.value;
                if (Stella_Object.isaP(input, Logic.SGT_STELLA_CONS)) {
                  (net.input.theArray)[i] = (FloatWrapper.wrapFloat(Logic.activateCachedNetwork(((Cons)(input)))));
                }
                else {
                  (net.input.theArray)[i] = (((FloatWrapper)(input)));
                }
              }
            }
            { int i = Stella.NULL_INTEGER;
              int iter004 = 0;
              int upperBound001 = net.hidden.length() - 1;

              for (;iter004 <= upperBound001; iter004 = iter004 + 1) {
                i = iter004;
                { int j = Stella.NULL_INTEGER;
                  int iter005 = 0;
                  int upperBound002 = net.input.length() - 1;

                  for (;iter005 <= upperBound002; iter005 = iter005 + 1) {
                    j = iter005;
                    sum = sum + (((FloatWrapper)((net.input.theArray)[j])).wrapperValue * ((FloatWrapper)((net.ih.theArray)[((j * net.ih.nofColumns) + i)])).wrapperValue);
                  }
                }
                (net.hidden.theArray)[i] = (FloatWrapper.wrapFloat(1.0 / (1.0 + Math.exp((0 - sum)))));
                score = score + (((FloatWrapper)((net.hidden.theArray)[i])).wrapperValue * ((FloatWrapper)((net.ho.theArray)[i])).wrapperValue);
              }
            }
            net.output = 1.0 / (1.0 + Math.exp((0 - score)));
            (scores.theArray)[k] = (FloatWrapper.wrapFloat(net.output));
          }
        }
      }
      if (Logic.$RULE_COMBINATION$ == Logic.KWD_MAX) {
        { FloatWrapper max = ((FloatWrapper)((scores.theArray)[0]));

          { int i = Stella.NULL_INTEGER;
            int iter006 = 0;
            int upperBound003 = scores.length() - 1;

            for (;iter006 <= upperBound003; iter006 = iter006 + 1) {
              i = iter006;
              if (((FloatWrapper)((scores.theArray)[i])).wrapperValue > max.wrapperValue) {
                max = ((FloatWrapper)((scores.theArray)[i]));
              }
            }
          }
          return (max.wrapperValue);
        }
      }
      else if (Logic.$RULE_COMBINATION$ == Logic.KWD_NOISY_OR) {
        switch (scores.length()) {
          case 0: 
            return (0.0);
          case 1: 
            return (((FloatWrapper)((scores.theArray)[0])).wrapperValue);
          case 2: 
            return (Logic.probabilisticSum(((FloatWrapper)((scores.theArray)[0])).wrapperValue, ((FloatWrapper)((scores.theArray)[1])).wrapperValue));
          default:
            { Cons consScores = Stella.NIL;

              { FloatWrapper ele = null;
                Vector vector000 = scores;
                int index000 = 0;
                int length000 = vector000.length();
                Cons collect000 = null;

                for (;index000 < length000; index000 = index000 + 1) {
                  ele = ((FloatWrapper)((vector000.theArray)[index000]));
                  if (collect000 == null) {
                    {
                      collect000 = Cons.cons(ele, Stella.NIL);
                      if (consScores == Stella.NIL) {
                        consScores = collect000;
                      }
                      else {
                        Cons.addConsToEndOfConsList(consScores, collect000);
                      }
                    }
                  }
                  else {
                    {
                      collect000.rest = Cons.cons(ele, Stella.NIL);
                      collect000 = collect000.rest;
                    }
                  }
                }
              }
              return (Logic.probabilisticSumN(consScores));
            }
        }
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("`" + Logic.$RULE_COMBINATION$ + "' is not a valid case option");
          throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
    }
  }