Skip to content

Hol iterate inside lambdas in simplifications - #1058

Open
mezpusz wants to merge 11 commits into
masterfrom
hol-iterate-inside-lambdas
Open

mezpusz wants to merge 11 commits into
masterfrom
hol-iterate-inside-lambdas

Conversation

@mezpusz

@mezpusz mezpusz commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Another remnant of the HOL branch, with a bit of improvement. It allows going into lambdas for (subsumption) demodulation. This would also yield terms that contain loose DB indices, for (subsumption) demodulation these are useless, so we simply avoid yielding them. Not binding terms with loose DB indices is handled by the indexing structures.

Results are not amazing, but show some improvement.

HOL TPTP Discount:

run 0 unsat: 2139 (7) sat: 1 (0) cputime: 10401.23 s instructions: 49437748 Mi memory: 241412.25 MB
run 1 unsat: 2146 (14) sat: 1 (0) cputime: 10349.94 s instructions: 49286501 Mi memory: 237456.11 MB

HOL TPTP Otter:

run 0 unsat: 2121 (9) sat: 1 (0) cputime: 10696.50 s instructions: 49874264 Mi memory: 341942.55 MB
run 1 unsat: 2127 (15) sat: 1 (0) cputime: 10637.84 s instructions: 49721435 Mi memory: 335902.12 MB

.filter([](Literal* lit){ return lit->isEquality(); })
.flatMap([](Literal* lit) {
return pvi(pushPairIntoRightIterator(lit, getUniquePersistentIterator<TermListHash, TermListHash2>(vi(new BooleanSubtermIt(lit)))));
return pvi(pushPairIntoRightIterator(lit, getUniquePersistentIterator<TermListHash, TermListHash2>(vi(new BooleanSubtermIterator(lit)))));

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.

Ooh, existing error but maybe this inner vi can be skipped as getUniquePersistentIterator takes a template?

Comment thread Kernel/TermIterators.hpp
_stack.push(t.term());
}
}
auto [lhs, rhs] = static_cast<Literal*>(term)->eqArgs();

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.

Because this is only used by HOL, and in HOL all literals are equations?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I vaguely remember that the phantom-sh type guards of Sledgehammer remain as non-eq literals (but of course only in TH1), something like well_ordering(\alpha)...

Comment thread Kernel/TermIterators.hpp
{
public:
BooleanSubtermIt(Term* term, bool includeSelf=false)
BooleanSubtermIterator(Term* term, bool = false)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this bool = false mean that the second argument has no purpose, but you don't want to change the interface?

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.

3 participants