summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/single_inv_partition.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-04-08 15:23:20 -0500
committerGitHub <noreply@github.com>2018-04-08 15:23:20 -0500
commitdf4fce8f41319c80ca13e20aefdad1dd32cb42bd (patch)
treeec469663b43132b0fab144b5678a7120d4e98e83 /src/theory/quantifiers/single_inv_partition.cpp
parente8f753f8ace5611c7204f390b7590a125e2bfa2a (diff)
Check free variables in assertions (#1737)
Diffstat (limited to 'src/theory/quantifiers/single_inv_partition.cpp')
-rw-r--r--src/theory/quantifiers/single_inv_partition.cpp39
1 files changed, 15 insertions, 24 deletions
diff --git a/src/theory/quantifiers/single_inv_partition.cpp b/src/theory/quantifiers/single_inv_partition.cpp
index 890b7fcd3..0a0dac4ba 100644
--- a/src/theory/quantifiers/single_inv_partition.cpp
+++ b/src/theory/quantifiers/single_inv_partition.cpp
@@ -250,37 +250,28 @@ bool SingleInvocationPartition::init(std::vector<Node>& funcs,
// now must check if it has other bound variables
std::vector<Node> bvs;
TermUtil::getBoundVars(cr, bvs);
- if (bvs.size() > d_si_vars.size())
+ // bound variables must be contained in the single invocation variables
+ for (const Node& bv : bvs)
{
- // getBoundVars also collects functions in the rare case that we are
- // synthesizing a function with 0 arguments
- // take these into account below.
- unsigned n_const_synth_fun = 0;
- for (unsigned j = 0; j < bvs.size(); j++)
+ if (std::find(d_si_vars.begin(), d_si_vars.end(), bv)
+ == d_si_vars.end())
{
- if (std::find(d_input_funcs.begin(), d_input_funcs.end(), bvs[j])
- != d_input_funcs.end())
+ // getBoundVars also collects functions in the rare case that we are
+ // synthesizing a function with 0 arguments, take this into account
+ // here.
+ if (std::find(d_input_funcs.begin(), d_input_funcs.end(), bv)
+ == d_input_funcs.end())
{
- n_const_synth_fun++;
+ Trace("si-prt")
+ << "...not ground single invocation." << std::endl;
+ ngroundSingleInvocation = true;
+ singleInvocation = false;
}
}
- if (bvs.size() - n_const_synth_fun > d_si_vars.size())
- {
- Trace("si-prt") << "...not ground single invocation." << std::endl;
- ngroundSingleInvocation = true;
- singleInvocation = false;
- }
- else
- {
- Trace("si-prt") << "...ground single invocation : success, after "
- "removing 0-arg synth functions."
- << std::endl;
- }
}
- else
+ if (singleInvocation)
{
- Trace("si-prt") << "...ground single invocation : success."
- << std::endl;
+ Trace("si-prt") << "...ground single invocation" << std::endl;
}
}
else
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback