1 /********************* */
2 /*! \file lemma_proof.h
4 ** Top contributors (to current version):
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS
8 ** in the top-level source directory) and their institutional affiliations.
9 ** All rights reserved. See the file COPYING in the top-level source
10 ** directory for licensing information.\endverbatim
12 ** A class for recoding the steps required in order to prove a theory lemma.
16 #include "cvc4_private.h"
18 #ifndef __CVC4__LEMMA_PROOF_H
19 #define __CVC4__LEMMA_PROOF_H
21 #include "expr/expr.h"
22 #include "proof/clause_id.h"
23 #include "prop/sat_solver_types.h"
24 #include "util/proof.h"
25 #include "expr/node.h"
29 class LemmaProofRecipe
{
33 ProofStep(theory::TheoryId theory
, Node literalToProve
);
34 theory::TheoryId
getTheory() const;
35 Node
getLiteral() const;
36 void addAssertion(const Node
& assertion
);
37 std::set
<Node
> getAssertions() const;
40 theory::TheoryId d_theory
;
41 Node d_literalToProve
;
42 std::set
<Node
> d_assertions
;
45 //* The lemma assertions and owner */
46 void addBaseAssertion(Node baseAssertion
);
47 std::set
<Node
> getBaseAssertions() const;
48 theory::TheoryId
getTheory() const;
51 typedef std::map
<Node
, Node
>::const_iterator RewriteIterator
;
52 RewriteIterator
rewriteBegin() const;
53 RewriteIterator
rewriteEnd() const;
55 void addRewriteRule(Node assertion
, Node explanation
);
56 bool wasRewritten(Node assertion
) const;
57 Node
getExplanation(Node assertion
) const;
60 void setOriginalLemma(Node lemma
);
61 Node
getOriginalLemma() const;
64 void addStep(ProofStep
& proofStep
);
65 const ProofStep
* getStep(unsigned index
) const;
66 ProofStep
* getStep(unsigned index
);
67 unsigned getNumSteps() const;
68 std::set
<Node
> getMissingAssertionsForStep(unsigned index
) const;
69 bool simpleLemma() const;
70 bool compositeLemma() const;
72 void dump(const char *tag
) const;
73 bool operator<(const LemmaProofRecipe
& other
) const;
76 //* The list of assertions for this lemma */
77 std::set
<Node
> d_baseAssertions
;
79 //* The various steps needed to derive the empty clause */
80 std::list
<ProofStep
> d_proofSteps
;
82 //* A map from assertions to their rewritten explanations (toAssert --> toExplain) */
83 std::map
<Node
, Node
> d_assertionToExplanation
;
85 //* The original lemma, as asserted by the owner theory solver */
89 } /* CVC4 namespace */
91 #endif /* __CVC4__LEMMA_PROOF_H */