Normalize types in constraints (#5407)

Signed-off-by: Krzysztof Bieganski <[email protected]>
This commit is contained in:
Krzysztof Bieganski
2024-08-27 12:53:44 +02:00
committed by GitHub
parent d40f7f5167
commit f623db7d68
4 changed files with 30 additions and 21 deletions
+5 -1
View File
@@ -337,11 +337,15 @@ bool VlRandomizer::next(VlRNG& rngr) {
f << "(set-option :produce-models true)\n";
f << "(set-logic QF_BV)\n";
f << "(define-fun __Vbv ((b Bool)) (_ BitVec 1) (ite b #b1 #b0))\n";
f << "(define-fun __Vbool ((v (_ BitVec 1))) Bool (= #b1 v))\n";
for (const auto& var : m_vars) {
f << "(declare-fun " << var.second->name() << " () (_ BitVec " << var.second->width()
<< "))\n";
}
for (const std::string& constraint : m_constraints) { f << "(assert " << constraint << ")\n"; }
for (const std::string& constraint : m_constraints) {
f << "(assert (= #b1 " << constraint << "))\n";
}
f << "(check-sat)\n";
bool sat = parseSolution(f);