protected Term extractTerm(String fis) {
        String line = "";
        for (char c : fis.toCharArray()) {
            if (!(c == '[' || c == ']')) {
                line += c;
            }
        }

        List<String> nameTerm = Op.split(line, ":");
        if (nameTerm.size() != 2) {
            throw new RuntimeException(String.format(
                    "[syntax error] expected term in format 'name':'class',[params], "
                    + "but found <%s>", line));
        }

        List<String> termParams = Op.split(nameTerm.get(1), ",");
        if (termParams.size() != 2) {
            throw new RuntimeException(String.format(
                    "[syntax error] expected term in format 'name':'class',[params], "
                    + "but found <%s>", line));
        }

        List<String> parameters = Op.split(termParams.get(1), " ");
        for (int i = 0; i < parameters.size(); ++i) {
            parameters.set(i, parameters.get(i).trim());
        }

        return createInstance(
                termParams.get(0).trim(),
                nameTerm.get(0).trim(),
                parameters);
    }