Skip to content

Input type cleanup 1 - #1051

Merged
quickbeam123 merged 5 commits into
masterfrom
martin-input-type-cleanup
Nov 10, 2026
Merged

quickbeam123 merged 5 commits into
masterfrom
martin-input-type-cleanup

Conversation

@quickbeam123

Copy link
Copy Markdown
Collaborator

Making things more sensible our yesterday's discussion. Version 1.

  • This, first and foremost, removes the strange condition in TPTPPrinter, where we would negated a formula based on it's UnitInputType and isClause status.
  • Remove the axiom_selection mode, which is better achieved as mode preprocess under some non-default sine settings
  • the InferenceRule is called CONJECTURE_NEGATION to better distinguish it from the UnitInputType
  • a comment explaining why Kostya needs the fake tautology clause in tclausify

What's next? Two big things I will only prepare later:

  • decouple UnitInputType in the sense of general-purpose analogue of formulas' TPTP role (which only makes sense for the input formulas) from the Unit's conjecture-relatedness status (which propagates through inferences and is used by various heuristics)
  • making these various heuristics more sensitive to this (where they seem to have been kind of ad hoc until now)

quickbeam123 and others added 4 commits November 5, 2026 17:28
The mode has no known users and has fallen behind the rest of the prover:
it never prints symbol declarations, so its output cannot be read back for
typed input, and it runs a preprocessing prefix of its own, so what it
selects can differ from what -ss axioms selects when proving. For instance,
it drops the axiom in

  fof(ax,axiom,p(a) => $distinct(a,b)).
  fof(goal,conjecture,p(a) => a != b).

because that axiom is triggered only by the $distinct marker literal, which
normal preprocessing has already expanded by the time it runs SInE.

The same functionality is available as --mode preprocess -ss axioms, since
with the clausifier off Preprocess::preprocess stops right after SInE. It
prints declarations, and handles higher-order input via the usual FOOL
elimination. Compared to the old mode, it also normalises interpreted
symbols and adds theory axioms; for typed input, add --theory_axioms off to
keep the output readable, as preprocess prints clauses without sorts.

Besides the mode, this removes Options::setSineSelection, which only the
mode called.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TPTPPrinter::printUnit negated any formula of input type CONJECTURE, so that
the unit the parsers derive by CONJECTURE_NEGATION would print as the stated
conjecture. The same applied to everything further down the derivation, and
the code needed Formula::quantify, a cleanup guard and special cases for the
polarity of the result. It also lost the conjecture's name, since the name
belongs to the stated unit, which was never printed:

  fof(goal,conjecture,~p(b)).
  vampire --mode output     prints tff(u3,conjecture, ~p(b))
  vampire --mode preprocess prints tff(u3,conjecture, ~p(b))

Now units are printed as they are, and the role tells them apart: a unit of
input type CONJECTURE is a conjecture only if it is the stated one, with rule
INPUT; anything derived from it is a negated_conjecture.

--mode output needs the stated conjecture, so it now prints the parent of
a CONJECTURE_NEGATION unit, which also brings back its name:

  vampire --mode output     prints tff(goal,conjecture, ~p(b))
  vampire --mode preprocess prints tff(u3,negated_conjecture, (~ ~p(b)))

A visible consequence is that preprocess and preprocess2 now print
negated_conjecture, as tpreprocess already did. Their output is not official
TPTP, and it re-reads as Unsatisfiable rather than Theorem, which is accepted.

This also makes the "CONJECTURE as inputType is evil" block in preprocessMode
redundant, so it is removed. Its reason went away with the parser's single
conjecture restriction; tpreprocess still prints negated_conjecture, now
through the role rule, because the unit is already negated.

The ProofOutput tests are updated to match, dropping the cases for the removed
negation branches and the test of its variable closure, which the TPTP parser
asserts is not needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread Shell/TPTPPrinter.cpp
} else {
negateFormula = true;
}
if (unit->inputType() == UnitInputType::CONJECTURE && unit->inference().rule() != InferenceRule::INPUT) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we assert here that unit->inference().rule() == InferenceRule::CONJECTURE_NEGATION? Are there other cases too?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually propagates through the inferences of preprocessing and further. There is a unique start of this, the CONJECTURE_NEGATION, but it does not end and we still (probably) want to keep recalling a unit comes from the conjecture.

@i-am-a-teapot i-am-a-teapot Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is better, but actually throws up another question for me. Should we print role negated_conjecture for everything that is tainted by the conjecture in proof output? It seems that e.g. E does so and it actually occurs in the example that Geoff uses (https://tptp.org/UserDocs/QuickGuide/Derivations.html , Formula c_0_8).
On the other hand https://proover-competition.github.io/rules-format/ disagrees here.
So if at a later point this function is used, we have this "taint" while in proof printing we don't.

If we don't want to go with this taint, I am thinking that maybe we should just leave this decision to the caller of the function (and defaulting to plain)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't mind that (the "leave this decision to the caller of the function (and defaulting to plain)").

Your link also made me notice my new rule name is breaking "A negated conjecture step must: use the inference rule name negated_conjecture;". What do you think, should I roll back or convince the future organizers they are wrong?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new name, it's in the present tense, like "binary resolution" - we don't say "binary resolved". Would be happy to lobby the organisers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sure these rules are able to be bent :) So I would then say that we leave the decision to what the rule is to the caller and fix that problem in that way!

Comment thread vampire.cpp Resolved
@easychair

easychair commented Nov 8, 2026 via email

Copy link
Copy Markdown
Contributor

@quickbeam123
quickbeam123 merged commit e778191 into master Nov 10, 2026
1 check passed
@quickbeam123
quickbeam123 deleted the martin-input-type-cleanup branch November 10, 2026 10:40
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.

5 participants