private void saveFactsAndAllRules(Collection<Rule> rules) throws IOException {
		if (null == rules || rules.size() == 0) return;
		for (Rule rule : rules) {
			StringBuilder sb = new StringBuilder();
			if (!rule.getLabel().startsWith(DEFAULT_RULE_LABEL_PREFIX)) sb.append(rule.getLabel());
			if (!"".equals(rule.getMode().getName())) {
				Mode mode = rule.getMode();
				sb.append(DflTheoryConst.MODE_START);
				sb.append(mode.toString());
				sb.append(DflTheoryConst.MODE_END);
			}
			if (sb.length() > 0) {
				sb.append(" " + DflTheoryConst.RULE_LABEL_SEPARATOR + " ");
				writer.write(sb.toString());
			}

			String ruleStr = rule.getRuleAsString();
			writer.write(ruleStr.replaceAll("" + DomConst.Literal.LITERAL_NEGATION_SIGN, DflTheoryConst.SYMBOL_NEGATION));
			writer.write(LINE_SEPARATOR);
		}
		writer.write(LINE_SEPARATOR);
	}