Fact-checked by Grok 2 weeks ago

Negation normal form

Negation normal form (NNF) is a standardized representation of propositional logic formulas where the operator (¬) is applied exclusively to atomic propositions (literals), and the formula is built using only (∧) and disjunction (∨) as the remaining connectives. This form eliminates negations over complex subformulas, ensuring that all negations are "pushed inward" to the level of individual variables or their direct negations. For example, formulas like ¬p ∧ ¬q or (¬p ∧ ¬q) ∨ r are in NNF, while ¬(p ∨ q) is not, as it requires transformation using to become ¬p ∧ ¬q. Any propositional formula can be equivalently converted to NNF through a systematic process that first removes non-standard connectives like implication (→) or equivalence (↔) by replacing them with combinations of ¬, ∧, and ∨—for instance, A → B ≡ ¬A ∨ B—and then applies double negation elimination (¬¬F ≡ F) and De Morgan's equivalences to distribute negations inward until none appear outside literals. This conversion is always possible and preserves logical equivalence, though the resulting NNF is not unique, as different application orders may yield structurally varied but semantically identical formulas. The process terminates in linear time relative to the formula's size when represented as a directed acyclic graph (DAG). NNF serves as a foundational step in and computation, facilitating further normalization to (CNF) or (DNF) for tasks such as testing. In , it is crucial for , where it simplifies proof calculi by restricting connectives to a functionally complete set {¬, ∧, ∨}, and for SAT solvers, which rely on NNF-derived forms to efficiently check formula satisfiability. Additionally, NNF enables multiset-based reasoning techniques and supports the analysis of formula properties like monotonicity in knowledge representation systems.

Fundamentals

Definition

In , negation normal form (NNF) is a syntactic of logical formulas where the (¬) is applied exclusively to propositions or predicates, and no negations appear over compound connectives such as (∧), disjunction (∨), (→), or biconditional (↔). This restriction ensures that all negations are "pushed" to the literals, simplifying the structure for further analysis while preserving . In propositional logic, formulas in NNF are constructed solely from atomic propositions (denoted as p, q, r, \dots), their negations (¬p, ¬q, etc.), and combinations using ∧ and ∨, with negations limited to the atomic level. The set of such formulas is the smallest collection containing all literals (positive or negative atoms) and closed under conjunction and disjunction. This concept extends to predicate (first-order) logic, where negations apply only to atomic formulas (predicates applied to terms), and quantifiers (∀ and ∃) may appear but are positioned outside any negations. In this setting, NNF formulas incorporate variables, terms, predicates, quantifiers, ∧, ∨, and literals, maintaining the negation restriction to facilitate reasoning over structures with relations and functions. Equivalently, a is in NNF if it results from systematically applying and elimination to move all negations inward until they reach atomic components.

Properties

Transforming a to negation normal form (NNF) preserves , ensuring that the resulting formula has identical truth conditions to the original. This preservation is achieved by applying a series of equivalence-preserving rewrite rules, including the elimination of implications and equivalences (e.g., A \to B \equiv \neg A \lor B) and the inward propagation of negations using (e.g., \neg(A \land B) \equiv \neg A \lor \neg B) and elimination (\neg\neg A \equiv A). As a result, the NNF formula is semantically indistinguishable from its predecessor, maintaining all logical inferences. In NNF, negations are restricted to literals, classifying each proposition's occurrence as either (the atom itself) or negative (its direct negation). This explicit structure arises from the process, where pushing negations inward systematically inverts the of affected subformulas—for instance, negating a flips both components to disjunctive negative literals. Such clarity enables precise tracking of how atomic assignments influence the overall , with positive occurrences contributing affirmatively to truth values and negative occurrences inversely. While NNF does not inherently enforce global monotonicity, the defined polarities support monotonic propagation analysis in positive (upward-entailing) or negative (downward-entailing) contexts within the formula's structure. A primary computational benefit of NNF lies in its simplification of negation handling, as all negations are isolated at the literal level, eliminating nested or complex negation scopes that complicate . This standardization reduces the cognitive and algorithmic overhead in further processing, such as transforming to (CNF) via distributivity, which is crucial for efficient testing. By avoiding repeated resolution during computation, NNF facilitates linear-time conversions in many cases and serves as a foundational step for tools like SAT solvers, where structured formulas accelerate conflict detection and clause learning. NNF representations for a given are not syntactically unique, as variations in the order of connectives or associative groupings can produce distinct but equivalent forms; however, all such versions remain logically equivalent and thus equisatisfiable with the original . This non-uniqueness stems from the flexibility in applying rewrite rules, yet the preservation of ensures that any NNF variant correctly captures the 's models without introducing or eliminating solutions. NNF plays a critical role in resolution-based theorem proving by providing a structured intermediate form that precedes conversion to clausal normal form. In this paradigm, formulas are first reduced to NNF to confine negations to atoms, allowing subsequent distributivity applications to yield a of clauses suitable for inferences. This step is indispensable for refutation procedures, where resolving complementary literals across clauses derives contradictions, enabling automated proofs of unsatisfiability or validity.

Examples

Basic Illustrations

To illustrate negation normal form (NNF) in propositional logic, consider the formula (P \land Q) \lor \neg R. This is in NNF because all negations apply directly to atomic propositions, with no negation over compound expressions; here, \neg R negates only the atom R, while the overall structure uses conjunction and disjunction on literals and atoms. In contrast, \neg (P \land Q) is not in NNF, as the negation operates over the conjunction connective rather than an atomic proposition alone. Extending to predicate logic, the formula \forall x (P(x) \to \neg Q(x)), equivalently \forall x (\neg P(x) \lor \neg Q(x)), is in NNF after pushing any inward across the ; negations now apply solely to the atomic predicates P(x) and Q(x). For a visual representation of structure in the propositional example (P \land Q) \lor \neg R, the branches from the root disjunction to the left child (conjunction of atoms P and Q) and right child ( of atom R), confirming no embedded negations beyond literals. Alternatively, its enumerates all assignments:
PQRP \land Q\neg R(P \land Q) \lor \neg R
TTTTFT
TTFTTT
TFTFFF
TFFFTT
FTTFFF
FTFFTT
FFTFFF
FFFFTT
This table highlights how the formula evaluates based on atomic values, underscoring the NNF property of direct negation application. Common patterns in NNF include formulas like (A \lor B) \land \neg C, where negations precede only atoms (C) and the rest combines literals via conjunction and disjunction.

Counterexamples

A common misconception arises with double negations applied to atomic propositions, such as ¬¬P, where one might incorrectly assume the formula is already in negation normal form (NNF) because negations are present only before atoms. However, NNF requires that negations be pushed inward and simplified, as double negation elimination yields the equivalent atomic formula P, eliminating the redundant negations entirely. In predicate logic, a more complex counterexample is ¬(∀x P(x)), which appears superficially simple but violates NNF because the negation applies directly to a quantified formula rather than an predicate. To achieve NNF, the must be pushed through the universal quantifier using the equivalence ¬∀x P(x) ≡ ∃x ¬P(x), resulting in a form where precedes only the P(x). This highlights the necessity of handling quantifier- interactions properly. Another pitfall in predicate logic involves universal quantification over negated atoms, such as ∀x ¬P(x), which is equivalent to ¬∃x P(x) but may lead to confusion if not recognized as already in NNF, since the negation is on the atomic predicate. In contrast, ∃x ¬P(x) is straightforwardly in NNF. The issue arises when attempting to standardize forms without pushing negations correctly, potentially mistaking the universal variant for requiring further transformation into an existential with negation.
Original FormulaWhy Invalid for NNFHint to Fix
¬(a ∧ b) applies to a , not an .Apply De Morgan's law to distribute .
a → (¬b ∨ c)Contains connective, which is not allowed.Rewrite as ¬a ∨ (¬b ∨ c).
¬¬a ∨ ¬b ∧ ¬c on and potential unnormalized .Eliminate to a, then normalize.
¬(∀x P(x)) over quantifier, not .Push : ∃x ¬P(x).

Conversion Methods

Manual Transformation Steps

To manually transform an arbitrary propositional logic formula into negation normal form (NNF), where negations appear only on atomic propositions, the process follows a sequence of logical equivalences applied recursively from the outer structure inward. Step 1 eliminates implications (→) and equivalences (↔) using the standard definitions P → Q ≡ ¬P ∨ Q and P ↔ Q ≡ (P ∧ Q) ∨ (¬P ∧ ¬Q). These replacements convert the formula to use only conjunction (∧), disjunction (∨), and negation (¬). Step 2 applies to distribute negations over conjunctions and disjunctions: ¬(P ∧ Q) ≡ ¬P ∨ ¬Q and ¬(P ∨ Q) ≡ ¬P ∧ ¬Q. This pushes negations deeper into the formula, transforming negated compound subformulas into equivalent positive combinations of negated literals. Step 3 resolves double negations by simplifying ¬¬P to P, removing redundant negation pairs wherever they occur. This step ensures no unnecessary negations persist after prior distributions. As a worked example, consider the ¬(P → (Q ∧ R)). First, eliminate the : ¬(P → (Q ∧ R)) ≡ P ∧ ¬(Q ∧ R). Next, apply De Morgan's law to the negated : P ∧ ¬(Q ∧ R) ≡ P ∧ (¬Q ∨ ¬R). No double negations appear, so the result is already in NNF: P ∧ (¬Q ∨ ¬R).

Algorithmic Approaches

One standard algorithmic approach to converting a propositional logic to negation normal form (NNF) involves a that traverses the 's structure bottom-up, applying rules to eliminate from non-atomic positions. The function NNF(φ) processes the φ as follows: if φ is an atomic or its , return φ unchanged; if φ is a ¬¬ψ, return NNF(ψ); if φ is a of a ¬(ψ ∧ ξ), return NNF(¬ψ) ∨ NNF(¬ξ); if φ is a of a disjunction ¬(ψ ∨ ξ), return NNF(¬ψ) ∧ NNF(¬ξ); for implications or equivalences, first rewrite them using disjunctions and (e.g., ψ → ξ becomes ¬ψ ∨ ξ) before recursing. This recursive procedure operates in linear time relative to the size of the input formula, as each connective is processed a constant number of times without introducing during the negation pushdown. Implementations typically represent the formula as an (AST), allowing the recursive function to traverse nodes and rewrite subtrees in place. Logic programming languages like facilitate this through term unification and recursion, as seen in libraries such as ProbLog, while Python-based tools use tree data structures for similar parsing and transformation in systems. To mitigate potential inefficiencies in large formulas, optimizations include delaying the expansion of disjunctions or conjunctions until necessary and using precedence-based rewriting to avoid redundant recursions, thereby preventing unnecessary intermediate growth. The following pseudocode illustrates the propositional case, assuming an AST representation where formulas are nodes with operators and children:
function NNF(φ):
    if φ is atomic or literal (¬p): return φ
    if φ is ¬¬ψ: return NNF(ψ)
    if φ is ¬(ψ ∧ ξ): return NNF(¬ψ) ∨ NNF(¬ξ)
    if φ is ¬(ψ ∨ ξ): return NNF(¬ψ) ∧ NNF(¬ξ)
    if φ is ψ → ξ: return NNF(¬ψ ∨ ξ)
    if φ is ψ ↔ ξ: return NNF((¬ψ ∨ ξ) ∧ (ψ ∨ ¬ξ))
    // Recurse on other connectives as needed
    else: return apply operator to NNF(children of φ)
A key limitation is the potential increase in formula size when negations are pushed inward, particularly if the original formula contains deeply nested connectives, though this growth is bounded linearly for NNF unlike subsequent forms like CNF.

Applications and Extensions

Uses in Logic and AI

In , negation normal form (NNF) serves as a crucial during the transformation of formulas for -based inference. By pushing negations inward to apply only to formulas, NNF eliminates implications and equivalences, preparing the formula for skolemization—which replaces existentially quantified variables with Skolem functions—and subsequent to clausal form, where the formula becomes a of disjunctions of literals. This stepwise ensures that rules, which operate on clauses, can be applied efficiently without handling complex nested negations, as demonstrated in foundational resolution frameworks. In AI planning, particularly within STRIPS-like domains, NNF simplifies the representation of preconditions and goals by isolating negations to literals, facilitating the elimination of negative literals through renaming. The process begins by converting all conditions to NNF, then replacing each negative literal ¬v with a new ˆv (initialized oppositely to v), and adjusting effects to preserve semantic , such as transforming v to v ∧ ¬ˆv. This yields a positive normal form that enhances search algorithms, like delete relaxation, by treating delete effects as additional preconditions, thereby improving efficiency in propositional domains without altering reachable states. Within knowledge bases employing (DLs), NNF standardizes negation placement by transforming concepts such that negations apply solely to atomic concepts, nominals, or specific role expressions, using to push negations inward (e.g., ¬(C₁ ⊓ C₂) ≡ ¬C₁ ⊔ ¬C₂). This form aids query answering by enabling uniform processing in automata-based, knot-based, and tableau algorithms, where it supports entailment checks and model construction; for instance, in expressive DLs like SROIQ, NNF ensures consistent evaluation of query-concept containment against the , achieving decidability in double-exponential time for complex queries. The linear-time transformation to NNF thus streamlines reasoning over inconsistent or epistemic knowledge bases. In , NNF reduces state space exploration by confining negations to atomic propositions, simplifying the translation of formulas (e.g., in HyperLTL or LTL extensions) into alternating Büchi automata. This atomic-level handling avoids propagating negations through quantifiers or temporal operators, enabling efficient emptiness checks and trace verification; for alternation-free fragments, it yields NLOGSPACE complexity relative to system size and for formula size, as negations are resolved directly in automaton transitions without expanding the state space for nested structures. A notable case study is the Nenofar solver, which preprocesses formulas into NNF to bypass traditional CNF conversion, integrating non-clausal with theory-specific reasoning. On 640 benchmarks from SMT-LIB and bounded , Nenofar achieved the best runtime on 243 instances with only 137 timeouts, outperforming CNF-based solvers (79–96 best times, 148–155 timeouts), particularly on non-clausal problems where NNF preserves structural information and accelerates decision procedures. Overall, NNF facilitates negation handling in non-monotonic reasoning by providing a flattened, -isolated that supports tableaux algorithms in logics like ALCKNF, where it decomposes assertions for checks and minimality enforcement in epistemic knowledge bases. This enables broader decidable reasoning over defaults and exceptions compared to monotonic settings. In recent developments in as of 2025, NNF circuits are employed for tractable probabilistic reasoning in hybrid neural-symbolic programs, enabling efficient evaluation of queries under probabilistic semantics while maintaining decomposability for complex inference tasks. Additionally, in learning specifications for stochastic systems, (LTL) formulas are converted to NNF to optimize the search for non-redundant patterns in probabilistic temporal properties. Negation normal form (NNF) admits variants adapted to particular classes of functions, such as negation-free NNF, where no negative literals appear in the , effectively restricting negations entirely from the . This variant, also termed NNF, uses only non-negative literals as inputs and is particularly suited for representing functions, which preserve the property that adding true literals cannot falsify the output. These restrictions enhance certain computational properties, like linear-time operations for or in compilation tasks. In propositional logic, NNF relates closely to (CNF) as a precursor structure; an NNF formula can be transformed into an equivalent CNF by applying the distributive law to expand nested disjunctions over conjunctions, though NNF is less restrictive by allowing arbitrary nesting of connectives beyond a flat conjunction of clauses. Similarly, NNF precedes (DNF) in the normalization hierarchy, where distribution of conjunctions over disjunctions yields a flat disjunction of conjunctions, again highlighting NNF's greater flexibility in structure. Extending to first-order logic, NNF precedes , in which all quantifiers are pulled to the outermost scope, typically after pushing negations inward to literals. builds further on this sequence, following prenex form by replacing existentially quantified variables with Skolem functions dependent on preceding universal variables, thus eliminating existentials while preserving . Converting an NNF formula to CNF or DNF often employs direct factoring and distribution, which can result in exponential size growth due to the expansion of nested operators. Alternatively, the Tseitin transformation addresses this by introducing auxiliary variables to encode the NNF structure, producing an equisatisfiable CNF formula whose size remains linear in the original. The following table compares NNF, CNF, and DNF across key criteria relevant to their structure and practical use in testing:
Normal FormStructureSize Relative to Arbitrary Satisfiability ComplexityUsability in SAT Solvers
NNFNested ∧/∨ with ¬ only on atoms (linear-time conversion)NP-completeIndirect; basis for knowledge compilation like DNNF for #SAT
CNF∧ of (∨ of literals)Potentially NP-completeDirect; standard input for CDCL solvers like MiniSat
DNF∨ of (∧ of literals)Potentially (check terms)Limited; inefficient for large instances due to size

References

  1. [1]
    [PDF] Normal Forms Logical Operators
    Sep 14, 2020 · • A formal is in negation normal form (NNF) if the negation symbol appears only in literals. • Example: • ¬p ∧ ¬q, (¬p ∧ ¬q) ∨ r are in NNF.
  2. [2]
    [PDF] Normal Forms
    A formula is in negation formal form (NNF) if negation (¬) occurs only directly in front of atoms. Example. In NNF: ¬A ∧ ¬B. Not in NNF: ¬(A ∨ B).
  3. [3]
    [PDF] Introduction to Mathematical Logic, Handout 3 Adequate Sets of ...
    A literal is an atom or the negation of an atom. A propositional formula is said to be in negation normal form if. • it contains no connectives other that ...<|control11|><|separator|>
  4. [4]
    [PDF] CS228 Logic for Computer Science 2021 Lecture 7 - CSE IITB
    Jan 30, 2021 · Write an algorithm that produces negation normal form (NNF) of the formula in linear time in the size of the DAG.
  5. [5]
    Negation Normal Form - an overview | ScienceDirect Topics
    4. Applications of Negation Normal Form in Computer Science · NNF plays a crucial role in automated theorem proving and satisfiability solvers. · Termination of ...
  6. [6]
  7. [7]
    4. Propositional Logic - GitHub Pages
    More concisely, the set of formulas in negation normal form is the smallest set of formulas containing the literals and closed under conjunction and disjunction ...
  8. [8]
    10. First-Order Logic - GitHub Pages
    10.4.​​ The notion of a formula in negation normal form carries over to first-order logic, where now we allow quantifiers as well. Every formula can be put in ...
  9. [9]
    Normal Forms for First-Order Logic - LARA - EPFL
    In negation normal form of formula the negation applies only to atomic formulas. ... expresses existential quantification over function symbols and relation ...
  10. [10]
    Automated Theorem Proving - Theory - CS Stanford
    One of the most significant developments in automated theorem proving occured in the 1930's and 1960's. In 1930, Herbrand proved an important theorem that ...
  11. [11]
    [PDF] PROPOSITIONAL LOGIC: MORE ON NORMAL FORMS
    A propositional formula is in conjunctive normal form (CNF) iff it is a conjunction of clauses. A formula in conjunctive normal form is in negation normal form.
  12. [12]
    [PDF] Normal Forms and Logical Consequence
    A formula is in negation normal form (NNF) if it does not contain the abbreviations → and ↔ and if it contains no negation symbols except possibly directly in ...
  13. [13]
    [PDF] RESOLUTION THEOREM PROVING - Theory and Logic Group
    A is in negation normal form (NNF) if it fulfils the following conditions: 1. the propositional connectives of A are in{ A , V , ¬ },. 2. ¬ occurs only in front ...
  14. [14]
    [PDF] Resolution Theorem Proving - Machine Logic
    Resolution Theorem Proving. 57. From negation normal form we get to conjunctive normal form by applying dis- tributivity rules: (α ∧ β) ∨ γ ⇒ (α ∨ γ) ...
  15. [15]
    [PDF] Propositional logic - CS@Purdue
    Obtain a 'negation normal form' (only atoms are negated!). N ::= P | ¬P | (N ∨ N) | (N ∧ N). P ::= p | q | r | ···. Done by the algorithm NNF. Input: formula ...
  16. [16]
    [PDF] Mathematical Logic - Stanford University
    Negation Normal Form. Page 72. Getting to NNF. ○ NNF is a stepping stone toward CNF: ○ Only have ∨, ∧, and ¬. ○ All negations pushed onto variables.
  17. [17]
    [PDF] Domain Compilation for Embedded Real-Time Planning
    Darwiche, A. 2002. A Compiler for Deterministic. Decomposable Negation Normal Form. In Proceedings of the Eighteenth National Conference on Artificial.
  18. [18]
    [PDF] Logic and Proof - IMDEA Software WordPress
    Take a formula in negation normal form. Starting from the outside, follow the nesting structure of the quantifiers. If the formula contains an existential ...
  19. [19]
    None
    ### Rules for Pushing Negations Across Quantifiers in First-Order Logic
  20. [20]
    [PDF] Chapter 10 Computation - Logic in Action
    Translating into CNF, third step The third and final step takes a formula in negation normal form and produces an equivalent formula in conjunctive normal form.
  21. [21]
    Propositional Logic - Stanford Encyclopedia of Philosophy
    May 18, 2023 · Propositional logic is the study of the meanings of, and the inferential relationships that hold among, sentences based on the role that a specific class of ...
  22. [22]
    Normal Forms for Propositional Logic - LARA
    Negation-Normal Form. In Negation ... Note that this transformation preserve equisatisfiability but not equivalence, because it introduces new variables.
  23. [23]
    How to Convert a Formula to CNF
    Here's a routine to convert any formula to CNF. CONVERT(φ): // returns a CNF formula equivalent to φ // Any syntactically valid propositional formula φ must ...
  24. [24]
    6. API Documentation - ProbLog - Read the Docs
    Transform a Prolog list to a Python list of terms. Parameters: term ... Copy a node with transformation to Negation Normal Form (only negation on facts).
  25. [25]
    [PDF] Planning and Optimization - Positive Normal Form and STRIPS
    Sep 30, 2024 · Convert all conditions to negation normal form (NNF). while any condition contains a negative literal ¬v: Let v be a variable which occurs ...
  26. [26]
  27. [27]
    [PDF] Algorithms for Model Checking HyperLTL and HyperCTL
    A formula ' is in negation normal form if the only occurrences of ¬ occur in front of propositions a⇡. Semantics. In the following we define the semantics for ...
  28. [28]
    [PDF] Nenofar: A Negation Normal Form SMT Solver - LARA - EPFL
    An indirect advantage of this choice is that the computation of implicants during conflict analysis can be done on clauses alone. 3.4 Combining Propositional ...
  29. [29]
    [PDF] Nonmonotonic Reasoning in Description Logic by Tableaux ...
    We use ˙¬C to denote the negation normal form of the ¬C. The set of individuals appearing in B is denoted by OB. We now briefly describe the ALCKNF ...
  30. [30]
    [PDF] Expander CNFs have Exponential DNNF Size - LIX
    A NNF is called negation free if its labels do not contain negative literals. Proposition 4. Let D be a DNNF computing a monotone Boolean function. There exists ...
  31. [31]
    [PDF] arXiv:2110.13014v1 [cs.CC] 25 Oct 2021
    Oct 25, 2021 · It is readily verified that monotone NNF, that is, NNF with non-negative literal inputs, are wDNNF. Page 6. In (Bova et al. 2014), see also ...
  32. [32]
    On the (Complete) Reasons Behind Decisions | Journal of Logic ...
    Aug 18, 2022 · A monotone NNF circuit can be negated and also conditioned in linear time to yield a monotone NNF circuit. Proof. The satisfiability of a ...
  33. [33]
    [PDF] Automated Logical Reasoning Lecture 2: Normal Forms and DPLL
    Negation Normal Form requires two syntactic restrictions: ▷ The only ... ▷ Example: ▷. ▷ Equisatisfiability is a much weaker notion than equivalence.
  34. [34]
    [PDF] SAT Solving Basics - Washington
    Tseitin's transformation converts a propositional formula F into an equisatisfiable CNF formula that is linear in the size of F. Key idea: introduce auxiliary.
  35. [35]
    [PDF] A Strongly Exponential Separation of DNNFs from CNF Formulas
    Feb 19, 2015 · Decomposable Negation Normal Forms (DNNFs) are Boolean circuits in negation normal form (NNF) such that the subcircuits leading into an AND ...