From 1dddbc74f01619928263b42bf4b4ef6a6ccb2f28 Mon Sep 17 00:00:00 2001 From: Andres Notzli Date: Tue, 9 Aug 2016 19:24:28 -0700 Subject: Add support for fewer preprocessing holes This commit adds support for the --fewer-preprocessing-holes flag. This flag changes the preprocessing part in proofs in two ways: it (1) removes assertions that are just restating inputs and uses the inputs directly instead and it (2) changes the form of the preprocessed assertions to contain the input that they originate from. The code in this commit is mostly taken from the proofs branch in Guy's fork. --- src/proof/proof_manager.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/proof/proof_manager.h') diff --git a/src/proof/proof_manager.h b/src/proof/proof_manager.h index cb5a2bdd1..fa7224d72 100644 --- a/src/proof/proof_manager.h +++ b/src/proof/proof_manager.h @@ -145,6 +145,7 @@ class ProofManager { // information that will need to be shared across proofs ExprSet d_inputFormulas; + std::map d_inputFormulaToName; ExprSet d_inputCoreFormulas; ExprSet d_outputCoreFormulas; @@ -156,12 +157,11 @@ class ProofManager { ProofFormat d_format; // used for now only in debug builds NodeToNodes d_deps; - // trace dependences back to unsat core - void traceDeps(TNode n); std::set d_printedTypes; std::map d_rewriteFilters; + std::map d_assertionFilters; std::vector d_rewriteLog; @@ -202,6 +202,9 @@ public: } assertions_iterator end_assertions() const { return d_inputFormulas.end(); } size_t num_assertions() const { return d_inputFormulas.size(); } + bool have_input_assertion(const Expr& assertion) { + return d_inputFormulas.find(assertion) != d_inputFormulas.end(); + } //---from Morgan--- Node mkOp(TNode n); @@ -220,6 +223,7 @@ public: static std::string getLearntClauseName(ClauseId id, const std::string& prefix = ""); static std::string getPreprocessedAssertionName(Node node, const std::string& prefix = ""); static std::string getAssertionName(Node node, const std::string& prefix = ""); + static std::string getInputFormulaName(const Expr& expr); static std::string getVarName(prop::SatVariable var, const std::string& prefix = ""); static std::string getAtomName(prop::SatVariable var, const std::string& prefix = ""); @@ -239,6 +243,8 @@ public: void addDependence(TNode n, TNode dep); void addUnsatCore(Expr formula); + // trace dependences back to unsat core + void traceDeps(TNode n, ExprSet* coreAssertions); void traceUnsatCore(); assertions_iterator begin_unsat_core() const { return d_outputCoreFormulas.begin(); } assertions_iterator end_unsat_core() const { return d_outputCoreFormulas.end(); } @@ -260,6 +266,8 @@ public: void addRewriteFilter(const std::string &original, const std::string &substitute); void clearRewriteFilters(); + void addAssertionFilter(const Node& node, const std::string& rewritten); + static void registerRewrite(unsigned ruleId, Node original, Node result); static void clearRewriteLog(); @@ -287,6 +295,9 @@ class LFSCProof : public Proof { std::ostream& os, std::ostream& paren, ProofLetMap& globalLetMap); + + void checkUnrewrittenAssertion(const NodeSet& assertions); + public: LFSCProof(SmtEngine* smtEngine, LFSCCoreSatProof* sat, -- cgit v1.2.3