@Override
	protected void transformTheoryToRegularFormImpl() throws TheoryNormalizerException {		
		List<Rule> rulesToAdd = new ArrayList<Rule>();
		Set<String> rulesToDelete = new TreeSet<String>();

		List<Literal> headLiterals = null;
		List<Literal> origHeadLiterals = null;
		Rule newRule1 = null;
		Rule newRule2 = null;
		Rule newRule3 = null;
		List<Rule> newRules = null;
		Map<String, List<Rule>> oldNewRuleMapping = new Hashtable<String, List<Rule>>();

		try {
			for (Rule rule : factsAndRules.values()) {
				logMessage(Level.FINER, 1, "transforming ", rule.getRuleType().getLabel(), " [", rule.getLabel(), "]");

				String originalRuleLabel=rule.getOriginalLabel();
				newRule1 = null;
				newRule2 = null;
				newRule3 = null;

				switch (rule.getRuleType()) {
				case STRICT:
					origHeadLiterals = rule.getHeadLiterals();
					headLiterals = rule.getHeadLiterals();

					String profixStr = (factsAndRules.containsKey(rule.getLabel() + TRANSFORM_POSTFIX)) ? (Utilities.getRandomString(5) + TRANSFORM_POSTFIX)
							: TRANSFORM_POSTFIX;

					newRule1 = DomUtilities.getRule(rule.getLabel() + profixStr, RuleType.STRICT);
newRule1.setOriginalLabel(originalRuleLabel);					
					addBodyLiterals(newRule1, rule.getBodyLiterals(), TRANSFORM_POSTFIX);
					addHeadLiterals(newRule1, headLiterals, TRANSFORM_POSTFIX);

					newRule2 = DomUtilities.getRule(rule.getLabel() + profixStr + TRANSFORM_POSTFIX2, RuleType.STRICT);
newRule2.setOriginalLabel(originalRuleLabel);
					addBodyLiterals(newRule2, headLiterals, TRANSFORM_POSTFIX);
					addHeadLiterals(newRule2, origHeadLiterals, "");

					// change the strict rule to defeasible rule, and
					// add the two new strict rules to the theory
					newRule3 = rule.clone();
newRule3.setOriginalLabel(originalRuleLabel);
					newRule3.setRuleType(RuleType.DEFEASIBLE);

					rulesToAdd.add(newRule1);
					rulesToAdd.add(newRule2);
					rulesToAdd.add(newRule3);
					rulesToDelete.add(rule.getLabel());
					break;
				case FACT:
					origHeadLiterals = rule.getHeadLiterals();
					headLiterals = rule.getHeadLiterals();

					String newFactStrictRuleLabel = theory.getUniqueRuleLabel(FACT_RULE_TRANSFORM_PREFIX);

					newRule1 = DomUtilities.getRule(newFactStrictRuleLabel, RuleType.STRICT);
newRule1.setOriginalLabel(originalRuleLabel);
					addHeadLiterals(newRule1, headLiterals, TRANSFORM_POSTFIX);

					newRule2 = DomUtilities.getRule(newFactStrictRuleLabel + TRANSFORM_POSTFIX, RuleType.STRICT);
newRule2.setOriginalLabel(originalRuleLabel);
					addBodyLiterals(newRule2, headLiterals, TRANSFORM_POSTFIX);
					addHeadLiterals(newRule2, origHeadLiterals, "");

					// delete the fact, and
					// add the two new strict rules to the theory
					rulesToDelete.add(rule.getLabel());
					rulesToAdd.add(newRule1);
					rulesToAdd.add(newRule2);
					break;
				case DEFEASIBLE:
					// expand the defeasible rule if number of head literal is
					// greater than 1
					// do nothing otherwise
					headLiterals = rule.getHeadLiterals();
					if (headLiterals.size() > 1) {
						logMessage(Level.FINER, 1, "expending ", rule.getRuleType().getLabel(), " [", rule.getLabel(), "]");
						newRules = expandDefeasibleRule(rule);

						// delete the old rule and add the expanded rules to the theory
						rulesToDelete.add(rule.getLabel());
						rulesToAdd.addAll(newRules);
						oldNewRuleMapping.put(rule.getLabel(), newRules);
					} else {
						logMessage(Level.FINER, 2, "no transform performed to ", rule.getRuleType().getLabel(), " [", rule.getLabel(), "]");
					}
					break;
				default:
					logMessage(Level.FINER, 2, "no transform performed to ", rule.getRuleType().getLabel(), " [", rule.getLabel(), "]");
				}
			}

			theory.updateTheory(rulesToAdd, rulesToDelete, oldNewRuleMapping);
		} catch (Exception e) {
			throw new TheoryNormalizerException(getClass(), ErrorMessage.THEORY_UPDATE_ERROR, e);
		} finally {
			if (!AppConst.isDeploy) {
				logMessage(Level.INFO, 0, "=== transformTheoryToRegularFormImpl - start ===");
				logMessage(Level.INFO, 0, null, theory);
				logMessage(Level.INFO, 0, "=== transformTheoryToRegularFormImpl -  end  ===");
			}
		}
	}