public static Cons loomThroughToKif(Cons tree, Cons implicitvariables) {
    { Stella_Object lowerbound = tree.rest.value;
      Stella_Object upperbound = tree.rest.rest.value;
      Cons clauses = Stella.NIL;

      if (Stella_Object.isaP(upperbound, Logic.SGT_STELLA_NUMBER_WRAPPER)) {
        { GeneralizedSymbol testValue000 = ((GeneralizedSymbol)(tree.value));

          if ((testValue000 == Logic.SYM_LOGIC_THROUGH) ||
              ((testValue000 == Logic.SYM_LOGIC_INTERVALii) ||
               (testValue000 == Logic.SYM_LOGIC_INTERVALi_))) {
            clauses = Cons.cons(Cons.list$(Cons.cons(Logic.SYM_STELLA_el, Cons.cons(((Symbol)(implicitvariables.value)), Cons.cons(Cons.cons(upperbound, Stella.NIL), Stella.NIL)))), clauses);
          }
          else if ((testValue000 == Logic.SYM_LOGIC_INTERVAL_i) ||
              (testValue000 == Logic.SYM_LOGIC_INTERVAL__)) {
            clauses = Cons.cons(Cons.list$(Cons.cons(Logic.SYM_STELLA_l, Cons.cons(((Symbol)(implicitvariables.value)), Cons.cons(Cons.cons(upperbound, Stella.NIL), Stella.NIL)))), clauses);
          }
          else {
            { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print("`" + testValue000 + "' is not a valid case option");
              throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
            }
          }
        }
      }
      if (Stella_Object.isaP(lowerbound, Logic.SGT_STELLA_NUMBER_WRAPPER)) {
        { GeneralizedSymbol testValue001 = ((GeneralizedSymbol)(tree.value));

          if ((testValue001 == Logic.SYM_LOGIC_THROUGH) ||
              ((testValue001 == Logic.SYM_LOGIC_INTERVALii) ||
               (testValue001 == Logic.SYM_LOGIC_INTERVAL_i))) {
            clauses = Cons.cons(Cons.list$(Cons.cons(Logic.SYM_STELLA_ge, Cons.cons(((Symbol)(implicitvariables.value)), Cons.cons(Cons.cons(lowerbound, Stella.NIL), Stella.NIL)))), clauses);
          }
          else if ((testValue001 == Logic.SYM_LOGIC_INTERVALi_) ||
              (testValue001 == Logic.SYM_LOGIC_INTERVAL__)) {
            clauses = Cons.cons(Cons.list$(Cons.cons(Logic.SYM_STELLA_g, Cons.cons(((Symbol)(implicitvariables.value)), Cons.cons(Cons.cons(lowerbound, Stella.NIL), Stella.NIL)))), clauses);
          }
          else {
            { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

              stream001.nativeStream.print("`" + testValue001 + "' is not a valid case option");
              throw ((StellaException)(StellaException.newStellaException(stream001.theStringReader()).fillInStackTrace()));
            }
          }
        }
      }
      return (((Cons)(Logic.conjoinSentences(clauses))));
    }
  }