public static DialogueOperatorEffect createAssertion(DialogueKBFormula left) throws Exception { DialogueOperatorEffect f = new DialogueOperatorEffect(); left = left.normalize(); if (left.isConstant()) { f.type = EffectType.ASSIGNMENT; f.left = left; f.right = DialogueKBFormula.trueFormula; return f; } else if (left.isNegatedFormula()) { DialogueKBFormula child = (DialogueKBFormula) left.getFirstChild(); if (child.isConstant()) { f.type = EffectType.ASSIGNMENT; f.left = child; f.right = DialogueKBFormula.falseFormula; return f; } } f.type = EffectType.ASSERTION; if (left.isNegatedFormula()) { left = (DialogueKBFormula) left.getFirstChild(); f.right = DialogueKBFormula.falseFormula; } else { f.right = DialogueKBFormula.trueFormula; } f.left = left; return f; }