public static Cons buildVariableConstraints(List instances) {
    { Cons constraints = Stella.NIL;

      { Symbol var = null;
        Cons iter000 = instances.theConsList;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          var = ((Symbol)(iter000.value));
          { Symbol name = ((Symbol)(Logic.$SYMBOL_VARIABLE_HASH_TABLE$.lookup(var)));

            if (!Logic.$DELETED_CASE_VARIABLES$.memberP(name)) {
              constraints = Cons.cons(Cons.list$(Cons.cons(Logic.SYM_LOGIC_SOFT_EQ, Cons.cons(name, Cons.cons(Cons.cons(Logic.internLogicSymbol("X" + Native.string_subsequence(Native.stringify(name), 1, Stella.NULL_INTEGER)), Stella.NIL), Stella.NIL)))), constraints);
            }
          }
        }
      }
      return (constraints);
    }
  }