Skip to content

internal iteration for clause generation - #917

Closed
MichaelRawson wants to merge 3 commits into
masterfrom
michael-clause-iteration
Closed

MichaelRawson wants to merge 3 commits into
masterfrom
michael-clause-iteration

Conversation

@MichaelRawson

Copy link
Copy Markdown
Contributor

Something a little controversial to think about.

Vampire builds massive iterator chains in order to carry out inference. However, all of them end up being consumed and passed through SaturationAlgorithm more-or-less unconditionally.

This PR adds a parallel method to e.g. GeneratingInferenceEngine that implements internal iteration rather than constructing a ClauseIterator, i.e.

  virtual ClauseIterator generateClauses(Clause* premise) = 0;
  virtual void generateClauses(Clause* premise, ClauseReceiver receive) {
    for(Clause *cl : iterTraits(generateClauses(premise)))
      receive(cl);
  }

I've re-plumbed SaturationAlgorithm to use internal iteration at clause activation.

The pay-off for all this is that writing inferences is often much more straightforward, easier to debug and possibly more performant. I've changed Factoring as a demonstration.

(also renamed SimplifyingGeneratingInference SimplifyingGeneratingInferenceEngine because it was confusing me)

This is just a proof of concept and would need more attention if we want to go ahead with it.

@MichaelRawson

Copy link
Copy Markdown
Contributor Author

CI failure is weird, it works locally. 🤷

@MichaelRawson

Copy link
Copy Markdown
Contributor Author

I for one greatly prefer #920. Let's keep the discussion going there.

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.

1 participant