This is in preparation for refactoring the printing of instantiations. We will migrate the printing of instantiations (currently done in the Instantiate module within quantifiers engine) to somewhere more high level e.g. the SmtEngine or in the command layer. This will make the infrastructure for dumping instantiations much more flexible, as implemented on proof-new.
theory/quantifiers/inst_match_trie.h
theory/quantifiers/inst_strategy_enumerative.cpp
theory/quantifiers/inst_strategy_enumerative.h
- theory/quantifiers/sygus_inst.cpp
- theory/quantifiers/sygus_inst.h
theory/quantifiers/instantiate.cpp
theory/quantifiers/instantiate.h
+ theory/quantifiers/instantiation_list.cpp
+ theory/quantifiers/instantiation_list.h
theory/quantifiers/lazy_trie.cpp
theory/quantifiers/lazy_trie.h
theory/quantifiers/proof_checker.cpp
theory/quantifiers/sygus/type_node_id_trie.h
theory/quantifiers/sygus/transition_inference.cpp
theory/quantifiers/sygus/transition_inference.h
+ theory/quantifiers/sygus_inst.cpp
+ theory/quantifiers/sygus_inst.h
theory/quantifiers/sygus_sampler.cpp
theory/quantifiers/sygus_sampler.h
theory/quantifiers/term_database.cpp
#include "proof/unsat_core.h"
#include "smt/command.h"
#include "smt/node_command.h"
+#include "theory/quantifiers/instantiation_list.h"
using namespace std;
}
}/* Printer::toStream(UnsatCore) */
+void Printer::toStream(std::ostream& out, const InstantiationList& is) const
+{
+ out << "(instantiations " << is.d_quant << std::endl;
+ for (const std::vector<Node>& i : is.d_inst)
+ {
+ out << " ( ";
+ for (const Node& n : i)
+ {
+ out << n << " ";
+ }
+ out << ")" << std::endl;
+ }
+ out << ")" << std::endl;
+}
+
+void Printer::toStream(std::ostream& out, const SkolemList& sks) const
+{
+ out << "(skolem " << sks.d_quant << std::endl;
+ out << " ( ";
+ for (const Node& n : sks.d_sks)
+ {
+ out << n << " ";
+ }
+ out << ")" << std::endl;
+ out << ")" << std::endl;
+}
+
Printer* Printer::getPrinter(OutputLanguage lang)
{
if(lang == language::output::LANG_AUTO) {
class Command;
class CommandStatus;
-class NodeCommand;
class UnsatCore;
+class InstantiationList;
+class SkolemList;
class Printer
{
/** Write an UnsatCore out to a stream with this Printer. */
virtual void toStream(std::ostream& out, const UnsatCore& core) const;
+ /** Write an instantiation list out to a stream with this Printer. */
+ virtual void toStream(std::ostream& out, const InstantiationList& is) const;
+
+ /** Write a skolem list out to a stream with this Printer. */
+ virtual void toStream(std::ostream& out, const SkolemList& sks) const;
+
/** Print empty command */
virtual void toStreamCmdEmpty(std::ostream& out,
const std::string& name) const;
--- /dev/null
+/********************* */
+/*! \file instantiation_list.cpp
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Andrew Reynolds
+ ** This file is part of the CVC4 project.
+ ** 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
+ **
+ ** \brief list of instantiations
+ **/
+
+#include "theory/quantifiers/instantiation_list.h"
+
+#include "options/base_options.h"
+#include "printer/printer.h"
+
+namespace CVC4 {
+
+std::ostream& operator<<(std::ostream& out, const InstantiationList& ilist)
+{
+ Printer::getPrinter(options::outputLanguage())->toStream(out, ilist);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const SkolemList& skl)
+{
+ Printer::getPrinter(options::outputLanguage())->toStream(out, skl);
+ return out;
+}
+
+} // namespace CVC4
--- /dev/null
+/********************* */
+/*! \file instantiation_list.h
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Andrew Reynolds
+ ** This file is part of the CVC4 project.
+ ** 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
+ **
+ ** \brief list of instantiations
+ **/
+
+#include "cvc4_private.h"
+
+#ifndef CVC4__THEORY__QUANTIFIERS__INSTANTIATION_LIST_H
+#define CVC4__THEORY__QUANTIFIERS__INSTANTIATION_LIST_H
+
+#include <iosfwd>
+#include <vector>
+
+#include "expr/node.h"
+
+namespace CVC4 {
+
+/** A list of instantiations for a quantified formula */
+struct InstantiationList
+{
+ InstantiationList(Node q, const std::vector<std::vector<Node> >& inst)
+ : d_quant(q), d_inst(inst)
+ {
+ }
+ /** The quantified formula */
+ Node d_quant;
+ /** The instantiation list */
+ std::vector<std::vector<Node> > d_inst;
+};
+
+/** Print the instantiation list to stream out */
+std::ostream& operator<<(std::ostream& out, const InstantiationList& ilist);
+
+/** The list of skolemization for a quantified formula */
+struct SkolemList
+{
+ SkolemList(Node q, const std::vector<Node>& sks) : d_quant(q), d_sks(sks) {}
+ /** The quantified formula */
+ Node d_quant;
+ /** The list of skolems for the quantified formula */
+ std::vector<Node> d_sks;
+};
+
+/** Print the skolem list to stream out */
+std::ostream& operator<<(std::ostream& out, const SkolemList& skl);
+
+} // namespace CVC4
+
+#endif /* CVC4__THEORY__QUANTIFIERS__INSTANTIATION_LIST_H */