Skip to content

[Model] NonTautology #867

@isPANN

Description

@isPANN

Motivation

NON-TAUTOLOGY (P260) from Garey & Johnson, A9 LO8. The dual of SAT under De Morgan's laws — asks whether a Boolean expression has a falsifying assignment. Introduces DNF as a formula representation. While interreducible with SAT via complementation, the distinct input format (DNF disjuncts vs CNF clauses) and evaluation semantics make it a separate model.

Associated rules:

Definition

Name: NonTautology
Reference: Garey & Johnson, Computers and Intractability, A9 LO8

**Canonical name:** Non-Tautology, also called DNF Falsifiability or co-SAT (when viewed as the complement of tautology checking).

Mathematical definition:

INSTANCE: Boolean expression E over a set U of variables, using the connectives "¬" (not), "∨" (or), "∧" (and), and "→" (implies).
QUESTION: Is E not a tautology, i.e., is there a truth assignment for U that makes E false?

NP-complete restriction: Remains NP-complete when E is in disjunctive normal form (DNF) with at most 3 literals per disjunct.

Variables

  • Count: n = |U| (one variable per Boolean variable)
  • Per-variable domain: binary {0, 1} (false/true)
  • Meaning: x_i = 1 if variable u_i is assigned true. The question asks whether there exists an assignment making E evaluate to false.

Schema (data type)

Type name: NonTautology
Variants: none

Field Type Description
num_vars usize Number of Boolean variables
disjuncts Vec<Vec<i32>> DNF disjuncts; each disjunct is a conjunction of literals (signed integers: positive = variable, negative = negated variable)

Notes:

  • This is a feasibility (decision) problem: Value = Or (does a falsifying assignment exist?).
  • Evaluation: E is false iff ALL disjuncts are false, i.e., for each disjunct, at least one literal in its conjunction is false.
  • Key getter methods: num_vars(), num_disjuncts() (= disjuncts.len()).
  • Duality with SAT: A DNF Non-Tautology instance with disjuncts D_1,...,D_m is exactly the negation of a CNF SAT instance with clauses C_1,...,C_m where each clause C_j has the complemented literals of D_j.

Complexity

  • Decision complexity: NP-complete (Cook, 1971; transformation from Satisfiability). Remains NP-complete when E is in DNF with at most 3 literals per disjunct.
  • Best known exact algorithm: Same as SAT, since Non-Tautology and SAT are interreducible with zero overhead. For DNF with 3 literals per disjunct (equivalent to 3-SAT): O*(1.307^n) by Biased-PPSZ (Scheder & Steinberger, 2017).
  • Concrete complexity expression: "1.307^num_vars" (for declare_variants!)
  • Special cases:
    • DNF with ≤ 2 literals per disjunct: polynomial (equivalent to 2-SAT)
    • CNF Non-Tautology: trivially decidable (check if any clause is a tautology)
  • References:
    • S.A. Cook (1971). "The Complexity of Theorem-Proving Procedures." STOC 1971, pp. 151-158.
    • D. Scheder, J.P. Steinberger (2017). "PPSZ for General k-SAT — Making Hertli's Analysis Simpler and 3-SAT Faster." CCC 2017.

Extra Remark

Full book text:

INSTANCE: Boolean expression E over a set U of variables, using the connectives "¬" (not), "∨" (or), "∧" (and), and "→" (implies).
QUESTION: Is E not a tautology, i.e., is there a truth assignment for U that makes E false?
Reference: [Cook, 1971a]. Transformation from SATISFIABILITY.
Comment: Remains NP-complete even if E is in "disjunctive normal form" with at most 3 literals per disjunct.

How to solve

  • It can be solved by (existing) bruteforce. (Enumerate all 2^n assignments; check if any makes E false.)
  • It can be solved by reducing to integer programming. (Negate to get CNF, encode as ILP; or directly encode "all disjuncts false" as ILP constraints. Companion rule issue to be filed separately.)
  • Other: Reduce to SAT via De Morgan negation, use any SAT solver.

Example Instance

Input:
n = 5 variables: x_1, x_2, x_3, x_4, x_5
DNF expression:
E = (x_1 ∧ x_2 ∧ x_3) ∨ (¬x_1 ∧ x_4) ∨ (¬x_2 ∧ ¬x_3 ∧ x_5) ∨ (x_3 ∧ ¬x_4 ∧ ¬x_5) ∨ (¬x_1 ∧ x_2 ∧ ¬x_5)

Represented as:

disjuncts = [[1, 2, 3], [-1, 4], [-2, -3, 5], [3, -4, -5], [-1, 2, -5]]

Falsifying assignment: (x_1, x_2, x_3, x_4, x_5) = (T, F, F, T, F):

  • D_1: T∧F∧F = F ✓
  • D_2: F∧T = F ✓
  • D_3: T∧T∧F = F ✓
  • D_4: F∧F∧T = F ✓
  • D_5: F∧F∧T = F ✓
  • E = F ∨ F ∨ F ∨ F ∨ F = FALSE ✓

Answer: YES — E is not a tautology. There are 13 falsifying assignments out of 32 total.

Non-satisfying assignment (E is true): (x_1, x_2, x_3, x_4, x_5) = (F, F, F, T, F):

  • D_2: ¬x_1 ∧ x_4 = T∧T = TRUE → E = TRUE.
    This assignment makes E true, so it is not a witness for non-tautology.
Python validation script
falsifying = []
for bits in range(32):
    x = [(bits >> i) & 1 for i in range(5)]
    d1 = x[0] and x[1] and x[2]
    d2 = (1-x[0]) and x[3]
    d3 = (1-x[1]) and (1-x[2]) and x[4]
    d4 = x[2] and (1-x[3]) and (1-x[4])
    d5 = (1-x[0]) and x[1] and (1-x[4])
    E = d1 or d2 or d3 or d4 or d5
    if not E:
        falsifying.append(tuple(x))

assert len(falsifying) == 13
assert (1, 0, 0, 1, 0) in falsifying  # proposed solution
assert (0, 0, 0, 1, 0) not in falsifying  # E is true here
print(f"Falsifying: {len(falsifying)}/32 (non-tautology confirmed)")

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoodAn issue passed all checks.modelA model problem to be implemented.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions