diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2020-03-22 21:05:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-22 21:05:37 -0700 |
commit | c9b7c3d6fcd49b6d75a85e1316e9918374d1ebbe (patch) | |
tree | 481ebcabeb01c576c5ae51269275ecd7ade9d4f3 /src/theory/strings/inference_manager.cpp | |
parent | c98ba7775ecb8a192e2a93735885163234546be3 (diff) |
Collect statistics about normal form inferences (#4127)
This commit adds code to count the number of inferences made of each
inference type for normal form inferences. It extends the Inference
enum in `infer_info.h` and adds two new `sendInference()` methods in the
`InferenceManager` to send and count inferences that have a corresonding
entry in the `Inference` enum.
Diffstat (limited to 'src/theory/strings/inference_manager.cpp')
-rw-r--r-- | src/theory/strings/inference_manager.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/theory/strings/inference_manager.cpp b/src/theory/strings/inference_manager.cpp index 389c4e7bf..eebad2274 100644 --- a/src/theory/strings/inference_manager.cpp +++ b/src/theory/strings/inference_manager.cpp @@ -34,11 +34,13 @@ InferenceManager::InferenceManager(TheoryStrings& p, context::UserContext* u, SolverState& s, SkolemCache& skc, - OutputChannel& out) + OutputChannel& out, + SequencesStatistics& statistics) : d_parent(p), d_state(s), d_skCache(skc), d_out(out), + d_statistics(statistics), d_keep(c), d_proxyVar(u), d_proxyVarToLength(u), @@ -186,13 +188,33 @@ void InferenceManager::sendInference(const std::vector<Node>& exp, sendInference(exp, exp_n, eq, c, asLemma); } -void InferenceManager::sendInference(const InferInfo& i) +void InferenceManager::sendInference(const std::vector<Node>& exp, + const std::vector<Node>& exp_n, + Node eq, + Inference infer, + bool asLemma) +{ + d_statistics.d_inferences << infer; + std::stringstream ss; + ss << infer; + sendInference(exp, exp_n, eq, ss.str().c_str(), asLemma); +} + +void InferenceManager::sendInference(const std::vector<Node>& exp, + Node eq, + Inference infer, + bool asLemma) { - std::stringstream ssi; - ssi << i.d_id; - sendInference(i.d_ant, i.d_antn, i.d_conc, ssi.str().c_str(), true); + d_statistics.d_inferences << infer; + std::stringstream ss; + ss << infer; + sendInference(exp, eq, ss.str().c_str(), asLemma); } +void InferenceManager::sendInference(const InferInfo& i) +{ + sendInference(i.d_ant, i.d_antn, i.d_conc, i.d_id, true); +} void InferenceManager::sendLemma(Node ant, Node conc, const char* c) { if (conc.isNull() || conc == d_false) |