Pelletier plans: THORN 23 and revised CoST v1
==========================================

All 24 cases in the originally failed Pelletier selection now have passing
CoST plans. This includes problem 34, which was commented out in the
original combined benchmark. dreadbury.shen is an additional plan checked
against the exact premises of Problems/dreadbury.shen.

These are typechecked, executable CoST plans. They are distinct from the
earlier ad hoc guided scripts. Each lemma must succeed; the plan aborts
otherwise, and end-of-plan assembles all subproofs.

Running
-------

Start shen-jit-stlib.exe in S42JiT. At the REPL:

  (cd "Lib/THORN")
  (tc -)
  (load "THORN.shen")
  (load "datatypes.shen")
  (load "CoST/CoSTv1.shen")
  (tc +)
  (maxinferences 1000000000)
  (load "Plans/Pelletier/pelletier53.shen")

The higher inference allowance concerns typechecking, not THORN's
per-query timeout. Each plan starts with initialise-plan, clears the
knowledge base and restores THORN defaults. Explicit search settings
follow within the plan where needed. No private settings helper is needed:
the revised CoSTv1 datatype accepts thorn.depth, thorn.timeout,
thorn.complex, thorn.equality and thorn.defaults as plan instructions.

Settings used
-------------

49: automatic equality rewriting is disabled after explicit substitution
    lemmas are proved.
53: depth 40, complexity 20 and automatic equality rewriting disabled for
    the finite classification and subsequent case merges.
73: depth 30 for the final finite refutation.
Other selected plans use default search settings. The query timeout
remains five seconds throughout.

Compilation of the declared premises at the beginning of 53 and 73 also
registers their fresh predicates before the narrowly scoped equality
lemmas are attempted. This avoids depending on an earlier session.

What each plan proves
---------------------

The proof input transformations are explicit in the source. Do not
describe all 24 as lemma-guided proofs of unchanged original queries.

18-22, 35, 40, 42, 51, 52 and 59:
  Fresh-symbol indirection. Given original premises A and target Q, add
  Q => k with k fresh and prove k. The new symbol does not occur in A or Q.
  This is the standard conservative indirection reduction; these are
  single-query plans rather than new multi-lemma mathematical strategies.

23:
  Separate fresh indirection symbols for the two directions of the
  equivalence, then combine their checked results using a fresh target.

34:
  Four fresh propositional definitions abbreviate the uniformity and
  existential/universal conditions appearing in the original query.
  The two uniformity equivalences are proved separately, and the final
  propositional step is scoped to those two checked lemmas. Expanding
  the definitions recovers the original problem. This avoids expanding
  the whole original query into CNF.

38:
  Fresh unary definitions abbreviate the two quantified subformulas and
  the two pointwise matrices. The plan proves sufficient cases and both
  directions of pointwise equivalence, then the equivalence of the two
  universal closures. Expanding the definitions recovers problem 38.

49:
  Original premises and original final target. A fresh binary definition
  abbreviates a two-point cover. The plan proves predicate substitution,
  identifies the cover points with a and b, proves that both cover points
  satisfy p, then transfers p to every point.

53:
  Explicitly Skolemised two-element premise: fresh constants p53-left
  and p53-right are distinct and cover the domain. Fresh unary predicates
  define singleton rows and columns; two fresh propositions define the
  original row and column descriptions.
  The proof classifies each row/column from its two Boolean cell values,
  classifies uniqueness from the two row/column values, checks all sixteen
  two-by-two matrices, and merges the checked cases in pairs. The final
  equivalence expands to the original query.
  This is a proof of the Skolemised, definitionally abbreviated formulation.

54:
  Original singleton-set premise, with fresh definitions of minimality,
  groundedness and the candidate set condition. Every formerly scoped
  step is proved as a universally quantified implication from the
  candidate condition. The final theorem says no candidate exists.
  Expanding the three nonrecursive definitions gives the original target.
  No unproved candidate-set assumption is added to the initial premises.

55, 63, 64, 66 and 69:
  Original premises and original final queries, with checked intermediate
  lemmas and controlled premise selection.

65:
  Original premises and original final query. A fresh proposition defines
  the exponent-two antecedent. All intermediate algebraic lemmas are
  proved conditionally on that proposition. The final original implication
  is proved within the plan, rather than discharged informally.

73:
  The two leading existential premises are explicitly Skolemised using
  fresh p73-o1 through p73-o4 and p73-h1 through p73-h3; their conjunctions
  are split into the stated witness facts. The assignment premise is
  retained. A fresh proposition defines the original uniqueness claim.
  Equality substitution, the four hole-choice clauses and eighteen
  collision clauses are proved. Collision lemmas are conditional on
  uniqueness. The final plan proves its negation; unfolding the fresh
  definition gives the original target.
  There is no unproved uniqueness assumption in the initial premises.
  This is a proof of the explicitly Skolemised formulation.

dreadbury:
  The exact premises from Problems/dreadbury.shen, with the lemma sequence
  adapted from 55. Its original final query is proved.

The definitions above use fresh symbols and are nonrecursive. Explicit
Skolem constants for 53 and 73 are fresh relative to their source problems.
Skolemisation, conjunction splitting and definitional abstraction are
preprocessing steps, outside the CoST plan datatype's checks. The datatype
checks the resulting stated premises, permitted scopes, lemma staging,
settings and final transformed target. THORN checks each actual derivation.
Indirection freshness and the stated correspondence to the original
problems are likewise preprocessing obligations; do not confuse them with
a theorem established by the plan datatype itself.

Files and results
-----------------

Each selected pelletierN.shen has a matching .log and -proof.txt.
timings.md contains padded, readable tables; results.json also records
checked-query counts, proof lengths, reported load times and source hashes.
All measurements include the supporting lemmas and final goal.
Exploratory/ preserves candidate plans, failed attempts and earlier logs.
Only the selected top-level plans constitute the successful replay set.

The final replay used THORN's corrected subsumed? test:

  C [C* | _] -> true where (subset? C* C)

Previously it discarded [p] in favour of [p q]. Therefore the earlier raw
benchmark timings are not a matched baseline for this corrected source.
Do not attribute every difference to planning. The original Problems
files and their previous timing tables were not overwritten.

Source SHA256
-------------

THORN.shen:
0B12DD8C2AC45A993BE1B23A39D0E7B07FDC61A3DEDF7B1E0C6536059A8DF03F
CoST/CoSTv1.shen:
44CA761B043BB3FC067C7FF1FEEF20E5F63676ACBD0D83AD3B25530F52A6EBB3


Plan cleanup, 18 November 2026
------------------------------
Thirteen consecutive redundant assume calls were removed from seven selected
plans. The initial premise compilation needed to register predicates in
53 and 73 was retained. All seven affected plans passed a fresh-session
replay, and their logs, assembled proofs and timing rows were refreshed.
Filenames are unchanged. Exploratory sources remain historical records.
