Skip to content

Bound ASPIC property-test theories and pin the #102 argument budget - #103

Merged
ctoth merged 1 commit into
mainfrom
test/aspic-generator-bounds
Sep 27, 2026
Merged

ctoth merged 1 commit into
mainfrom
test/aspic-generator-bounds

Conversation

@ctoth

@ctoth ctoth commented Sep 27, 2026

Copy link
Copy Markdown
Owner

This PR contains test-only safeguards for #102 and makes no production change. The production fix, rule canonicalisation (option A in the investigation comment), is waiting on a semantic decision, so #102 stays open.

Problem

The ASPIC rule generators in tests/structured/aspic/test_aspic.py drew rule antecedents with replacement. One seed such as ~q, ~q -> p, together with its positional transpositions (~p, ~q) -> q and (~q, ~p) -> q, multiplied a 4-premise theory into 18,850 arguments and roughly 306M attack pairs. Once Hypothesis saved that example in a local database, it replayed on every run: the test hit the 600s timeout, and pytest then raised a MemoryError while formatting the traceback.

Changes

  • strict_rules, strict_seed_rules and defeasible_rules now draw distinct antecedents in canonical (sorted) order, using _distinct_antecedents.

  • knowledge_base and well_defined_knowledge_base reject theories with more than 2,000 arguments, via assume(...). The count is taken from build_arguments with an empty contrariness function. Because the c-consistency filter only ever removes arguments, that count is an upper bound on the real argument set. As a result, any saved example, including an old one, is discarded rather than run through compute_attacks.

  • tests/structured/aspic/test_aspic_argument_budget.py pins the ASPIC compute_attacks blows up on cyclic strict rules: 4 premises, 14 rules give 18,850 arguments and ~8.7M rebuttals #102 theory with a deterministic operational contract (AGENTS.md):

    • at most 200 arguments;
    • at most 20,000 attack pairs, counted from per-conclusion argument counts, without calling compute_attacks.

    It is marked xfail(strict=True) until option A lands. It fails in about 0.5s instead of timing out. A control confirms that a small theory with distinct antecedents stays within budget.

Refs #102

🤖 Generated with Claude Code

https://claude.ai/code/session_01V4tAVyyKcs1sYcsEzL7Bzg

…dget

The ASPIC strict/defeasible rule generators drew antecedents with
replacement. A seed like ~q, ~q -> p, plus its positional transpositions,
multiplied arguments to 18,850 (~306M attacks) on a 4-premise theory;
once saved in a local Hypothesis database it replayed into the 600s
timeout on every run.

- Rule generators draw distinct antecedents in canonical order.
- knowledge_base and well_defined_knowledge_base reject theories whose
  argument set (built without contrariness, an upper bound) exceeds 2,000,
  so no saved example can replay a blow-up.
- The #102 theory is pinned with a deterministic operational contract
  (<= 200 arguments, <= 20,000 attack pairs counted from per-conclusion
  argument counts without compute_attacks), xfail(strict=True) until the
  production fix lands; it fails in about 0.5s instead of timing out.

Refs #102

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V4tAVyyKcs1sYcsEzL7Bzg
@ctoth
ctoth merged commit 0360927 into main Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant