Skip to content

[Model] MinimumAxiomSet #869

@isPANN

Description

@isPANN

Motivation

MINIMUM AXIOM SET (P269) from Garey & Johnson, A9 LO17. A generalization of Set Cover with multi-level deductive closure via implication rules. Given a set of sentences, a set of true sentences, and implication rules, find the smallest subset of true sentences whose deductive closure equals the full set of true sentences.

Associated rules:

Structural connections:

  • Generalizes MinimumSetCovering (single-antecedent implications reduce to Set Cover)
  • Equivalent to Minimum Generating Set for a closure system
  • Equivalent to Minimum Source Set on directed hypergraphs

Definition

Name: MinimumAxiomSet
Reference: Garey & Johnson, Computers and Intractability, A9 LO17

Mathematical definition:

INSTANCE: Finite set S of "sentences," subset T ⊆ S of "true sentences," an "implication relation" R consisting of pairs (A, s) where A ⊆ S and s ∈ S.
OBJECTIVE: Find the minimum-size subset S₀ ⊆ T whose deductive closure under R equals T.

The deductive closure is computed iteratively: S₀ ⊆ S₁ ⊆ ... ⊆ Sₙ where Sᵢ = Sᵢ₋₁ ∪ {s : ∃U ⊆ Sᵢ₋₁, (U, s) ∈ R}, until fixpoint Sₙ = Sₙ₊₁.

Variables

  • Count: |T| (one binary variable per candidate axiom in T)
  • Per-variable domain: binary {0, 1}
  • Meaning: y_s = 1 if sentence s is selected as an axiom in S₀. Minimize |S₀| = Σ y_s such that the deductive closure of S₀ equals T.

Schema (data type)

Type name: MinimumAxiomSet
Variants: none

Field Type Description
num_sentences usize Total number of sentences
true_sentences Vec<usize> Indices of true sentences T ⊆ S
implications Vec<(Vec<usize>, usize)> Implication rules: (antecedent set A, consequent s)

Notes:

  • This is an optimization problem: Value = Min<usize>.
  • Key getter methods: num_sentences() (= |S|), num_true_sentences() (= |T|), num_implications() (= |R|).

Complexity

  • Decision complexity: NP-complete (Pudlák, 1975; transformation from X3C). NP-complete even if T = S.
  • Best known exact algorithm: O*(2^|T|) brute force — enumerate all subsets of T, compute deductive closure for each (polynomial per subset via fixpoint).
  • Concrete complexity expression: "2^num_true_sentences" (for declare_variants!)
  • Approximation: O(log |T|) via greedy (analogous to Set Cover greedy).
  • References:
    • P. Pudlák (1975). "Polynomially complete problems in the logic of automated discovery." MFCS 1975.

Extra Remark

Full book text:

INSTANCE: Finite set S of "sentences," subset T⊆S of "true sentences," an "implication relation" R consisting of pairs (A,s) where A⊆S and s∈S, and a positive integer K≤|S|.
QUESTION: Is there a subset S_0⊆T with |S_0|≤K and a positive integer n such that, if we define S_i, 1≤i≤n, to consist of exactly those s∈S for which either s∈S_{i-1} or there exists a U⊆S_{i-1} such that (U,s)∈R, then S_n=T?
Reference: [Pudlák, 1975]. Transformation from X3C.
Comment: Remains NP-complete even if T=S.

How to solve

  • It can be solved by (existing) bruteforce. (Enumerate subsets of T by increasing size; compute deductive closure; return smallest whose closure = T.)
  • It can be solved by reducing to integer programming. (Binary variable per sentence; layered indicator variables for fixpoint; minimize Σ y_s. Companion rule issue to be filed separately.)
  • Other: Greedy approximation (O(log |T|) ratio).

Example Instance

Input:
S = {a, b, c, d, e, f, g, h} (8 sentences), T = S (all true)

Implication rules:

  1. ({a}, c) — a → c
  2. ({a}, d) — a → d
  3. ({b}, e) — b → e
  4. ({b}, f) — b → f
  5. ({c, e}, g) — c ∧ e → g (multi-antecedent)
  6. ({d, f}, h) — d ∧ f → h (multi-antecedent)
  7. ({g, h}, a) — g ∧ h → a
  8. ({g, h}, b) — g ∧ h → b

Optimal axiom set (size 2): S₀ = {a, b}

  • Step 0: {a, b}
  • Step 1: a → c, d; b → e, f. S₁ = {a, b, c, d, e, f}
  • Step 2: {c, e} → g; {d, f} → h. S₂ = {a, b, c, d, e, f, g, h} = T ✓

Optimal value: Min(2) — 2 solutions exist: {a, b} and {g, h}.

Second solution: S₀ = {g, h}

  • Step 0: {g, h}
  • Step 1: {g, h} → a; {g, h} → b. S₁ = {a, b, g, h}
  • Step 2: a → c, d; b → e, f. S₂ = {a, b, c, d, e, f, g, h} = T ✓

Why size 1 is insufficient:

  • {a}: closure = {a, c, d} (cannot reach e, f, g, h)
  • {b}: closure = {b, e, f} (cannot reach c, d, g, h)
  • {g} or {h} alone: no rules fire (both need the other as co-antecedent)
  • Other singletons: no rules have them as sole antecedent
Python validation script
from itertools import combinations

rules = [
    ({0}, 2), ({0}, 3), ({1}, 4), ({1}, 5),
    ({2, 4}, 6), ({3, 5}, 7), ({6, 7}, 0), ({6, 7}, 1),
]
T = set(range(8))

def closure(axioms):
    current = set(axioms)
    changed = True
    while changed:
        changed = False
        for ante, cons in rules:
            if ante.issubset(current) and cons not in current:
                current.add(cons); changed = True
    return current

for k in range(9):
    found = [c for c in combinations(range(8), k) if closure(c) == T]
    if found:
        assert k == 2
        names = "abcdefgh"
        print(f"Min axiom set: {k} ({len(found)} solutions)")
        for f in found:
            print(f"  {{{', '.join(names[i] for i in f)}}}")
        break

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