def delta(self, i: PLInterpretation, epsilon=False) -> PLFormula: f = self.to_nnf() d = f._delta(i, epsilon) if epsilon: # By definition, if epsilon=True, then the result must be either PLTrue or PLFalse # Now, the output is a Propositional Formula with only PLTrue or PLFalse as atomics # Hence, we just evaluate the formula with a dummy PLInterpretation d = PLTrue() if d.truth(None) else PLFalse() return d
def delta(self, i: PropositionalInterpretation, epsilon=False) -> PLFormula: """Apply the delta function.""" f = self.to_nnf() d = f._delta(i, epsilon=epsilon) if epsilon: # By definition, if epsilon=True, then the result must be either True or False. # The output is a Propositional Formula with only True or False as atomics. # Hence, we just evaluate the formula with the empty propositional interpretation. d = PLTrue() if d.truth({}) else PLFalse() return d