Skip to content

Skolemization format update#849

Open
i-am-a-teapot wants to merge 8 commits into
masterfrom
skolemization-tstp
Open

Skolemization format update#849
i-am-a-teapot wants to merge 8 commits into
masterfrom
skolemization-tstp

Conversation

@i-am-a-teapot
Copy link
Copy Markdown

Update for TPTP proof output for Skolemization for #843

i-am-a-teapot and others added 2 commits April 29, 2026 14:33
Co-authored-by: Copilot <copilot@github.com>
@i-am-a-teapot i-am-a-teapot marked this pull request as ready for review May 7, 2026 12:31
@i-am-a-teapot
Copy link
Copy Markdown
Author

The TSTP standard has changed to allow multiple skolemizations now, which this new format should be compatible with.
I ran some test files which looked fine, however there may be edge cases which I am not aware of (seems like skolemization works slighlty differently for higher order things)

Copy link
Copy Markdown
Contributor

@MichaelRawson MichaelRawson left a comment

Choose a reason for hiding this comment

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

Hi @i-am-a-teapot - thanks for the patch! Got some questions about it but it's looking good, we should have this in for CASC. :)

Comment thread Shell/Skolem.cpp Outdated
Comment thread Kernel/InferenceStore.cpp Outdated
Comment thread Kernel/InferenceStore.cpp Outdated
Comment thread Kernel/InferenceStore.cpp
} else {
return env.signature->typeConName(sym.second);
}
}
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.

Good idea. I feel like this could be promoted to Signature.hpp if it doesn't exist already?

Comment thread Shell/Skolem.hpp Outdated
Stack<std::pair<bool, unsigned>> _introducedSkolemSyms;

// Type, numberOfSymbol, Variable that was replaced by the skolem symbol, Variables that are in scope for a skolem symbol (for proof recording purposes)
Stack<std::tuple<bool, unsigned, unsigned, std::unique_ptr<std::vector<unsigned>>>> _introducedSkolemSyms;
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.

The first bool is whether the Skolem is for sorts or terms, I think. So: could this be a pair <unsigned, Term *> where the lhs is the variable being eliminated and the rhs is the Skolem term?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I modified it to use what you suggested and I think, it should be equivalent to check the term kind (if it is sort or not). (I also checked what is happening in Term and that seems to be ok, but maybe I am missing something)

In some tests I ran this seems to work, let me know if you see a problem with it!

@easychair
Copy link
Copy Markdown
Contributor

easychair commented May 10, 2026 via email

@i-am-a-teapot
Copy link
Copy Markdown
Author

Skolemization previously consisted of two steps in our proof output: Introducing the symbol and another step which is the eliminating the existential.
The TSTP format is now slightly changed so we need to be more detailed for skolemization (so we keep recording skolemization!). Pretty much the simplest way of adhering to the required format, is to just do everything in one single step (printing all relevant detail in this single step) instead of splitting it in two.

Comment thread Kernel/SubstHelper.hpp
VSList::push({newVar, sort}, newVars);
if(newVar!=v) {
VSList::push({newVar, newSort}, newVars);
if(newVar!=v || newSort!=sort) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In case you are wondering what is happening here:
I tried out a problem (see below), and (default) vampire crashed in tptp proof output mode due to not replacing the skolemized type in the polymorphic container(A), leaving an unbound variable. This should fix it I hope.

tff(container_type, type, (
    container: $tType > $tType
)).
tff(contains_pred, type, (
    contains: !> [A: $tType] : ( A * container(A) ) > $o
)).
tff(trigger_axiom, axiom, (
    ! [A: $tType] : 
      ! [X: A] : 
        ? [C: container(A)] : contains(A, X, C)
)).

% 4. Conjecture to complete valid TPTP problem state
tff(dummy_conjecture, conjecture, (
    ! [A: $tType] : 
      ! [X: A] : 
        ? [C: container(A)] : contains(A, X, C)
)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants