1 /********************* */
4 ** Original author: Liana Hadarean
5 ** Major contributors: Morgan Deters
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 project.
8 ** Copyright (c) 2009-2014 New York University and The University of Iowa
9 ** See the file COPYING in the top-level source directory for licensing
10 ** information.\endverbatim
12 ** \brief A manager for CnfProofs.
14 ** A manager for CnfProofs.
19 #ifndef __CVC4__CNF_PROOF_H
20 #define __CVC4__CNF_PROOF_H
22 #include "cvc4_private.h"
23 #include "util/proof.h"
24 #include "proof/sat_proof.h"
26 #include <ext/hash_set>
27 #include <ext/hash_map>
39 ProofManager::var_iterator d_it
;
42 AtomIterator(CnfProof
& cnf
, const ProofManager::var_iterator
& it
)
43 : d_cnf(cnf
), d_it(it
)
45 inline Expr
operator*();
46 AtomIterator
& operator++() { ++d_it
; return *this; }
47 AtomIterator
operator++(int) { AtomIterator x
= *this; ++d_it
; return x
; }
48 bool operator==(const AtomIterator
& it
) const { return &d_cnf
== &it
.d_cnf
&& d_it
== it
.d_it
; }
49 bool operator!=(const AtomIterator
& it
) const { return !(*this == it
); }
50 };/* class AtomIterator */
54 CVC4::prop::CnfStream
* d_cnfStream
;
55 Expr
getAtom(prop::SatVariable var
);
56 friend class AtomIterator
;
58 CnfProof(CVC4::prop::CnfStream
* cnfStream
);
60 typedef AtomIterator iterator
;
61 virtual iterator
begin_atom_mapping() = 0;
62 virtual iterator
end_atom_mapping() = 0;
64 virtual void printAtomMapping(std::ostream
& os
, std::ostream
& paren
) = 0;
65 virtual void printClauses(std::ostream
& os
, std::ostream
& paren
) = 0;
69 class LFSCCnfProof
: public CnfProof
{
70 void printInputClauses(std::ostream
& os
, std::ostream
& paren
);
71 void printTheoryLemmas(std::ostream
& os
, std::ostream
& paren
);
72 void printClause(const prop::SatClause
& clause
, std::ostream
& os
, std::ostream
& paren
);
75 LFSCCnfProof(CVC4::prop::CnfStream
* cnfStream
)
79 virtual iterator
begin_atom_mapping();
80 virtual iterator
end_atom_mapping();
82 virtual void printAtomMapping(std::ostream
& os
, std::ostream
& paren
);
83 virtual void printClauses(std::ostream
& os
, std::ostream
& paren
);
86 inline Expr
AtomIterator::operator*() {
87 return d_cnf
.getAtom(*d_it
);
90 } /* CVC4 namespace */
92 #endif /* __CVC4__CNF_PROOF_H */