diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-07-01 08:46:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-01 08:46:30 -0500 |
commit | 12af221551c34a4bffc0282e7b3fa8dea661190c (patch) | |
tree | 40a384f74915e2c009bb2a66bd0295e62edcfc2e /src/proof | |
parent | c62980dab74b3db795961f90a4c49c463437a8eb (diff) | |
parent | 04154c08c1af81bb751376ae9379c071a95c5a3f (diff) |
Merge branch 'master' into lfscTestslfscTests
Diffstat (limited to 'src/proof')
47 files changed, 124 insertions, 118 deletions
diff --git a/src/proof/arith_proof.cpp b/src/proof/arith_proof.cpp index 7b56c176f..635767b97 100644 --- a/src/proof/arith_proof.cpp +++ b/src/proof/arith_proof.cpp @@ -2,9 +2,9 @@ /*! \file arith_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir, Guy Katz, Liana Hadarean + ** Alex Ozdemir, Liana Hadarean, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/arith_proof.h b/src/proof/arith_proof.h index b889614f1..832afcae0 100644 --- a/src/proof/arith_proof.h +++ b/src/proof/arith_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir, Guy Katz, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/arith_proof_recorder.cpp b/src/proof/arith_proof_recorder.cpp index c240f9582..01da402c9 100644 --- a/src/proof/arith_proof_recorder.cpp +++ b/src/proof/arith_proof_recorder.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/arith_proof_recorder.h b/src/proof/arith_proof_recorder.h index 3fff6968d..0669e5d16 100644 --- a/src/proof/arith_proof_recorder.h +++ b/src/proof/arith_proof_recorder.h @@ -2,9 +2,9 @@ /*! \file arith_proof_recorder.h ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/array_proof.cpp b/src/proof/array_proof.cpp index 32dcaf5b2..2d42a7489 100644 --- a/src/proof/array_proof.cpp +++ b/src/proof/array_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz, Yoni Zohar, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/array_proof.h b/src/proof/array_proof.h index 55cda0aba..ffcff165a 100644 --- a/src/proof/array_proof.h +++ b/src/proof/array_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Mathias Preiner, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/bitvector_proof.cpp b/src/proof/bitvector_proof.cpp index fddcb9e78..98e3300f5 100644 --- a/src/proof/bitvector_proof.cpp +++ b/src/proof/bitvector_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Guy Katz, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/bitvector_proof.h b/src/proof/bitvector_proof.h index 8264d3bc4..9a9071e58 100644 --- a/src/proof/bitvector_proof.h +++ b/src/proof/bitvector_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir, Mathias Preiner, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/clausal_bitvector_proof.cpp b/src/proof/clausal_bitvector_proof.cpp index 6a5009b1f..21e8056ca 100644 --- a/src/proof/clausal_bitvector_proof.cpp +++ b/src/proof/clausal_bitvector_proof.cpp @@ -2,9 +2,9 @@ /*! \file clausal_bitvector_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Mathias Preiner, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/clausal_bitvector_proof.h b/src/proof/clausal_bitvector_proof.h index 2047e325c..28a53c90c 100644 --- a/src/proof/clausal_bitvector_proof.h +++ b/src/proof/clausal_bitvector_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/clause_id.h b/src/proof/clause_id.h index 4a9ebc74a..b2d36c9cb 100644 --- a/src/proof/clause_id.h +++ b/src/proof/clause_id.h @@ -2,9 +2,9 @@ /*! \file clause_id.h ** \verbatim ** Top contributors (to current version): - ** Paul Meng + ** Paul Meng, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/cnf_proof.cpp b/src/proof/cnf_proof.cpp index 21636650d..677bf2f8c 100644 --- a/src/proof/cnf_proof.cpp +++ b/src/proof/cnf_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Andrew Reynolds, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/cnf_proof.h b/src/proof/cnf_proof.h index e589950bc..56993583e 100644 --- a/src/proof/cnf_proof.h +++ b/src/proof/cnf_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Guy Katz, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/dimacs.cpp b/src/proof/dimacs.cpp index fd5b79383..d9d9f8c1c 100644 --- a/src/proof/dimacs.cpp +++ b/src/proof/dimacs.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/dimacs.h b/src/proof/dimacs.h index 5956c5d26..405b33208 100644 --- a/src/proof/dimacs.h +++ b/src/proof/dimacs.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/drat/drat_proof.cpp b/src/proof/drat/drat_proof.cpp index e35741cde..ee9c42d77 100644 --- a/src/proof/drat/drat_proof.cpp +++ b/src/proof/drat/drat_proof.cpp @@ -2,9 +2,9 @@ /*! \file drat_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/drat/drat_proof.h b/src/proof/drat/drat_proof.h index 082107d0a..1213c80c7 100644 --- a/src/proof/drat/drat_proof.h +++ b/src/proof/drat/drat_proof.h @@ -2,9 +2,9 @@ /*! \file drat_proof.h ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/er/er_proof.cpp b/src/proof/er/er_proof.cpp index 9b036c3a6..54b0fd879 100644 --- a/src/proof/er/er_proof.cpp +++ b/src/proof/er/er_proof.cpp @@ -2,9 +2,9 @@ /*! \file er_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Andres Noetzli, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/er/er_proof.h b/src/proof/er/er_proof.h index 9fc40e64e..6f7239ef2 100644 --- a/src/proof/er/er_proof.h +++ b/src/proof/er/er_proof.h @@ -2,9 +2,9 @@ /*! \file er_proof.h ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/lemma_proof.cpp b/src/proof/lemma_proof.cpp index f4249f3d5..bdebb6cfc 100644 --- a/src/proof/lemma_proof.cpp +++ b/src/proof/lemma_proof.cpp @@ -2,9 +2,9 @@ /*! \file lemma_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Guy Katz, Alex Ozdemir + ** Guy Katz, Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/lemma_proof.h b/src/proof/lemma_proof.h index 7dfce57cf..ffc6655a6 100644 --- a/src/proof/lemma_proof.h +++ b/src/proof/lemma_proof.h @@ -2,9 +2,9 @@ /*! \file lemma_proof.h ** \verbatim ** Top contributors (to current version): - ** Guy Katz, Alex Ozdemir + ** Guy Katz, Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/lfsc_proof_printer.cpp b/src/proof/lfsc_proof_printer.cpp index 1a18d06a6..464083841 100644 --- a/src/proof/lfsc_proof_printer.cpp +++ b/src/proof/lfsc_proof_printer.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Andres Noetzli, Alex Ozdemir, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/lfsc_proof_printer.h b/src/proof/lfsc_proof_printer.h index f2f55aa94..62547676f 100644 --- a/src/proof/lfsc_proof_printer.h +++ b/src/proof/lfsc_proof_printer.h @@ -2,9 +2,9 @@ /*! \file lfsc_proof_printer.h ** \verbatim ** Top contributors (to current version): - ** Andres Noetzli, Alex Ozdemir + ** Andres Noetzli, Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/lrat/lrat_proof.cpp b/src/proof/lrat/lrat_proof.cpp index 4a19f07be..69ffa623a 100644 --- a/src/proof/lrat/lrat_proof.cpp +++ b/src/proof/lrat/lrat_proof.cpp @@ -2,9 +2,9 @@ /*! \file lrat_proof.cpp ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Andres Noetzli, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/lrat/lrat_proof.h b/src/proof/lrat/lrat_proof.h index f5a11fd4e..1c065a08e 100644 --- a/src/proof/lrat/lrat_proof.h +++ b/src/proof/lrat/lrat_proof.h @@ -2,9 +2,9 @@ /*! \file lrat_proof.h ** \verbatim ** Top contributors (to current version): - ** Alex Ozdemir + ** Alex Ozdemir, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/proof.h b/src/proof/proof.h index 9e7e20a22..be5af32db 100644 --- a/src/proof/proof.h +++ b/src/proof/proof.h @@ -2,9 +2,9 @@ /*! \file proof.h ** \verbatim ** Top contributors (to current version): - ** Tim King, Liana Hadarean, Morgan Deters + ** Tim King, Liana Hadarean, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/proof_manager.cpp b/src/proof/proof_manager.cpp index f9e3293fa..99e3010b4 100644 --- a/src/proof/proof_manager.cpp +++ b/src/proof/proof_manager.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz, Liana Hadarean, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -565,6 +565,30 @@ void LFSCProof::toStream(std::ostream& out, const ProofLetMap& map) const Unreachable(); } +void collectAtoms(TNode node, std::set<Node>& seen, CnfProof* cnfProof) +{ + Debug("pf::pm::atoms") << "collectAtoms: Colleting atoms from " << node + << "\n"; + if (seen.find(node) != seen.end()) + { + Debug("pf::pm::atoms") << "collectAtoms:\t already seen\n"; + return; + } + // if I have a SAT literal for a node, save it, unless this node is a + // negation, in which case its underlying will be collected downstream + if (cnfProof->hasLiteral(node) && node.getKind() != kind::NOT) + { + Debug("pf::pm::atoms") << "collectAtoms: has SAT literal, save\n"; + seen.insert(node); + } + for (unsigned i = 0; i < node.getNumChildren(); ++i) + { + Debug("pf::pm::atoms") << push; + collectAtoms(node[i], seen, cnfProof); + Debug("pf::pm::atoms") << pop; + } +} + void LFSCProof::toStream(std::ostream& out) const { TimerStat::CodeTimer proofProductionTimer( @@ -683,10 +707,15 @@ void LFSCProof::toStream(std::ostream& out) const d_cnfProof->collectAtomsForClauses(used_lemmas, atoms); // collects the atoms in the assertions + Debug("pf::pm") << std::endl + << "LFSCProof::toStream: Colleting atoms from assertions " + << used_assertions << "\n" + << push; for (TNode used_assertion : used_assertions) { - utils::collectAtoms(used_assertion, atoms); + collectAtoms(used_assertion, atoms, d_cnfProof); } + Debug("pf::pm") << pop; std::set<Node>::iterator atomIt; Debug("pf::pm") << std::endl diff --git a/src/proof/proof_manager.h b/src/proof/proof_manager.h index a59f36858..45bde4dcb 100644 --- a/src/proof/proof_manager.h +++ b/src/proof/proof_manager.h @@ -2,9 +2,9 @@ /*! \file proof_manager.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Guy Katz, Morgan Deters + ** Liana Hadarean, Guy Katz, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/proof_output_channel.cpp b/src/proof/proof_output_channel.cpp index aa2175e66..1e6e759e3 100644 --- a/src/proof/proof_output_channel.cpp +++ b/src/proof/proof_output_channel.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz, Tim King, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/proof_output_channel.h b/src/proof/proof_output_channel.h index ff84a3743..6a91bad7c 100644 --- a/src/proof/proof_output_channel.h +++ b/src/proof/proof_output_channel.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Tim King, Guy Katz, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/proof_utils.cpp b/src/proof/proof_utils.cpp index 3342d421a..cad56db6a 100644 --- a/src/proof/proof_utils.cpp +++ b/src/proof/proof_utils.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Andrew Reynolds, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -21,19 +21,6 @@ namespace CVC4 { namespace utils { -void collectAtoms(TNode node, std::set<Node>& seen) { - if (seen.find(node) != seen.end()) - return; - if (theory::Theory::theoryOf(node) != theory::THEORY_BOOL || node.isVar()) { - seen.insert(node); - return; - } - - for (unsigned i = 0; i < node.getNumChildren(); ++i) { - collectAtoms(node[i], seen); - } -} - std::string toLFSCKind(Kind kind) { switch(kind) { // core kinds diff --git a/src/proof/proof_utils.h b/src/proof/proof_utils.h index 23f221cf6..e54edd8b7 100644 --- a/src/proof/proof_utils.h +++ b/src/proof/proof_utils.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Guy Katz, Dejan Jovanovic ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim @@ -225,8 +225,5 @@ inline const bool getBit(Expr expr, unsigned i) { return (bit == 1u); } -void collectAtoms(TNode node, std::set<Node>& seen); - - } } diff --git a/src/proof/resolution_bitvector_proof.cpp b/src/proof/resolution_bitvector_proof.cpp index 120397d08..d48789f71 100644 --- a/src/proof/resolution_bitvector_proof.cpp +++ b/src/proof/resolution_bitvector_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir, Liana Hadarean, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/resolution_bitvector_proof.h b/src/proof/resolution_bitvector_proof.h index 5fd11092f..a1b0b0d59 100644 --- a/src/proof/resolution_bitvector_proof.h +++ b/src/proof/resolution_bitvector_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Alex Ozdemir, Mathias Preiner, Liana Hadarean ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/sat_proof.h b/src/proof/sat_proof.h index ec0928c07..83e4d3930 100644 --- a/src/proof/sat_proof.h +++ b/src/proof/sat_proof.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King, Andres Noetzli ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/sat_proof_implementation.h b/src/proof/sat_proof_implementation.h index 8c65d42e7..897a5c452 100644 --- a/src/proof/sat_proof_implementation.h +++ b/src/proof/sat_proof_implementation.h @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Tim King, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/simplify_boolean_node.cpp b/src/proof/simplify_boolean_node.cpp index 0fd69fc20..5f1943654 100644 --- a/src/proof/simplify_boolean_node.cpp +++ b/src/proof/simplify_boolean_node.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz, Liana Hadarean, Andrew Reynolds ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/simplify_boolean_node.h b/src/proof/simplify_boolean_node.h index fe8b7174b..bb4fe2e47 100644 --- a/src/proof/simplify_boolean_node.h +++ b/src/proof/simplify_boolean_node.h @@ -2,9 +2,9 @@ /*! \file simplify_boolean_node.h ** \verbatim ** Top contributors (to current version): - ** Guy Katz + ** Mathias Preiner, Guy Katz ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/skolemization_manager.cpp b/src/proof/skolemization_manager.cpp index 44ca08fa6..1bb14598d 100644 --- a/src/proof/skolemization_manager.cpp +++ b/src/proof/skolemization_manager.cpp @@ -2,9 +2,9 @@ /*! \file skolemization_manager.cpp ** \verbatim ** Top contributors (to current version): - ** Paul Meng, Tim King + ** Paul Meng, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/skolemization_manager.h b/src/proof/skolemization_manager.h index cb23268f3..a2c61db4d 100644 --- a/src/proof/skolemization_manager.h +++ b/src/proof/skolemization_manager.h @@ -2,9 +2,9 @@ /*! \file skolemization_manager.h ** \verbatim ** Top contributors (to current version): - ** Guy Katz, Tim King + ** Guy Katz, Tim King, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/theory_proof.cpp b/src/proof/theory_proof.cpp index f4a762cb0..66109bfac 100644 --- a/src/proof/theory_proof.cpp +++ b/src/proof/theory_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Guy Katz, Liana Hadarean, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/theory_proof.h b/src/proof/theory_proof.h index 85c8e5fee..dd5fe0326 100644 --- a/src/proof/theory_proof.h +++ b/src/proof/theory_proof.h @@ -2,9 +2,9 @@ /*! \file theory_proof.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Guy Katz, Yoni Zohar + ** Liana Hadarean, Guy Katz, Alex Ozdemir ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/uf_proof.cpp b/src/proof/uf_proof.cpp index 225cb6aa4..74990ff44 100644 --- a/src/proof/uf_proof.cpp +++ b/src/proof/uf_proof.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Liana Hadarean, Guy Katz, Yoni Zohar ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/uf_proof.h b/src/proof/uf_proof.h index 834f6ef9e..647359a87 100644 --- a/src/proof/uf_proof.h +++ b/src/proof/uf_proof.h @@ -2,9 +2,9 @@ /*! \file uf_proof.h ** \verbatim ** Top contributors (to current version): - ** Liana Hadarean, Mathias Preiner, Tim King + ** Mathias Preiner, Liana Hadarean, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/unsat_core.cpp b/src/proof/unsat_core.cpp index 0776197cb..e54d976c9 100644 --- a/src/proof/unsat_core.cpp +++ b/src/proof/unsat_core.cpp @@ -4,7 +4,7 @@ ** Top contributors (to current version): ** Morgan Deters, Clark Barrett, Tim King ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/unsat_core.h b/src/proof/unsat_core.h index 0217b6326..c0dd36ea5 100644 --- a/src/proof/unsat_core.h +++ b/src/proof/unsat_core.h @@ -2,9 +2,9 @@ /*! \file unsat_core.h ** \verbatim ** Top contributors (to current version): - ** Morgan Deters, Andrew Reynolds, Liana Hadarean + ** Morgan Deters, Andrew Reynolds, Mathias Preiner ** This file is part of the CVC4 project. - ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS + ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS ** in the top-level source directory) and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim diff --git a/src/proof/unsat_core.i b/src/proof/unsat_core.i index c37c8551d..780a75996 100644 --- a/src/proof/unsat_core.i +++ b/src/proof/unsat_core.i @@ -1,17 +1,37 @@ %{ #include "proof/unsat_core.h" +%} + +%ignore CVC4::operator<<(std::ostream&, const UnsatCore&); #ifdef SWIGJAVA -#include "bindings/java_iterator_adapter.h" -#include "bindings/java_stream_adapters.h" +%typemap(javabody) CVC4::UnsatCore %{ + private long swigCPtr; + protected boolean swigCMemOwn; + private ExprManager em; -#endif /* SWIGJAVA */ + protected $javaclassname(ExprManager em, long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + this.em = em; + } + + protected static long getCPtr($javaclassname obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + public JavaIteratorAdapter_UnsatCore iterator() { + return new JavaIteratorAdapter_UnsatCore(this.em, this); + } %} -%ignore CVC4::operator<<(std::ostream&, const UnsatCore&); +%typemap(javaout) CVC4::Expr { + return new Expr(this.em, $jnicall, true); +} -#ifdef SWIGJAVA +%ignore CVC4::UnsatCore::UnsatCore(); +%ignore CVC4::UnsatCore::UnsatCore(SmtEngine* smt, std::vector<Expr> core); // Instead of UnsatCore::begin() and end(), create an // iterator() method on the Java side that returns a Java-style @@ -20,12 +40,8 @@ %ignore CVC4::UnsatCore::end(); %ignore CVC4::UnsatCore::begin() const; %ignore CVC4::UnsatCore::end() const; -%extend CVC4::UnsatCore { - CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr> iterator() - { - return CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr>(*$self); - } +%extend CVC4::UnsatCore { std::string toString() { std::stringstream ss; @@ -37,36 +53,13 @@ // UnsatCore is "iterable" on the Java side %typemap(javainterfaces) CVC4::UnsatCore "java.lang.Iterable<edu.stanford.CVC4.Expr>"; -// the JavaIteratorAdapter should not be public, and implements Iterator -%typemap(javaclassmodifiers) CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr> "class"; -%typemap(javainterfaces) CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr> "java.util.Iterator<edu.stanford.CVC4.Expr>"; -// add some functions to the Java side (do it here because there's no way to do these in C++) -%typemap(javacode) CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr> " - public void remove() { - throw new java.lang.UnsupportedOperationException(); - } - - public edu.stanford.CVC4.Expr next() { - if(hasNext()) { - return getNext(); - } else { - throw new java.util.NoSuchElementException(); - } - } -" -// getNext() just allows C++ iterator access from Java-side next(), make it private -%javamethodmodifiers CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr>::getNext() "private"; - #endif /* SWIGJAVA */ %include "proof/unsat_core.h" #ifdef SWIGJAVA -%include <std_vector.i> - -%include "bindings/java_iterator_adapter.h" - +SWIG_JAVA_ITERATOR_ADAPTER(CVC4::UnsatCore, CVC4::Expr) %template(JavaIteratorAdapter_UnsatCore) CVC4::JavaIteratorAdapter<CVC4::UnsatCore, CVC4::Expr>; #endif /* SWIGJAVA */ |