result = self.csolver.getAbductNext(output.cterm)
return result
+ def blockModel(self):
+ """
+ Block the current model. Can be called only if immediately preceded by a
+ SAT or INVALID query.
+
+ SMT-LIB:
+
+ .. code-block:: smtlib
+
+ (block-model)
+
+ Requires enabling option
+ :ref:`produce-models <lbl-option-produce-models>`
+ and setting option
+ :ref:`block-models <lbl-option-block-models>`
+ to a mode other than ``none``.
+ """
+ self.csolver.blockModel()
+
+ def blockModelValues(self, terms):
+ """
+ Block the current model values of (at least) the values in terms. Can be
+ called only if immediately preceded by a SAT or NOT_ENTAILED query.
+
+ SMT-LIB:
+
+ .. code-block:: smtlib
+
+ (block-model-values ( <terms>+ ))
+
+ Requires enabling option
+ :ref:`produce-models <lbl-option-produce-models>`.
+ """
+ cdef vector[c_Term] nts
+ for t in terms:
+ nts.push_back((<Term?> t).cterm)
+ self.csolver.blockModelValues(nts)
cdef class Sort:
with pytest.raises(RuntimeError):
solver.pop(1)
+def test_block_model1(solver):
+ solver.setOption("produce-models", "true")
+ x = solver.mkConst(solver.getBooleanSort(), "x")
+ solver.assertFormula(x.eqTerm(x))
+ solver.checkSat()
+ with pytest.raises(RuntimeError):
+ solver.blockModel()
+
+def test_block_model2(solver):
+ solver.setOption("block-models", "literals")
+ x = solver.mkConst(solver.getBooleanSort(), "x")
+ solver.assertFormula(x.eqTerm(x))
+ solver.checkSat()
+ with pytest.raises(RuntimeError):
+ solver.blockModel()
+
+def test_block_model3(solver):
+ solver.setOption("produce-models", "true")
+ solver.setOption("block-models", "literals")
+ x = solver.mkConst(solver.getBooleanSort(), "x")
+ solver.assertFormula(x.eqTerm(x))
+ with pytest.raises(RuntimeError):
+ solver.blockModel()
+
+def test_block_model4(solver):
+ solver.setOption("produce-models", "true")
+ solver.setOption("block-models", "literals")
+ x = solver.mkConst(solver.getBooleanSort(), "x");
+ solver.assertFormula(x.eqTerm(x))
+ solver.checkSat()
+ solver.blockModel()
+
+def test_block_model_values1(solver):
+ solver.setOption("produce-models", "true")
+ solver.setOption("block-models", "literals")
+ x = solver.mkConst(solver.getBooleanSort(), "x");
+ solver.assertFormula(x.eqTerm(x))
+ solver.checkSat()
+ with pytest.raises(RuntimeError):
+ solver.blockModelValues([])
+ with pytest.raises(RuntimeError):
+ solver.blockModelValues([cvc5.Term(solver)])
+ with pytest.raises(RuntimeError):
+ solver.blockModelValues([cvc5.Solver().mkBoolean(False)])
+
+def test_block_model_values2(solver):
+ solver.setOption("produce-models", "true")
+ x = solver.mkConst(solver.getBooleanSort(), "x")
+ solver.assertFormula(x.eqTerm(x))
+ solver.checkSat()
+ solver.blockModelValues([x])
+
+def test_block_model_values3(solver):
+ solver.setOption("block-models", "literals")
+ x = solver.mkConst(solver.getBooleanSort(), "x")
+ solver.assertFormula(x.eqTerm(x))
+ solver.checkSat()
+ with pytest.raises(RuntimeError):
+ solver.blockModelValues([x])
+
+def test_block_model_values4(solver):
+ solver.setOption("produce-models", "true")
+ solver.setOption("block-models", "literals")
+ x = solver.mkConst(solver.getBooleanSort(), "x")
+ solver.assertFormula(x.eqTerm(x))
+ with pytest.raises(RuntimeError):
+ solver.blockModelValues([x])
+
+def test_block_model_values5(solver):
+ solver.setOption("produce-models", "true")
+ solver.setOption("block-models", "literals")
+ x = solver.mkConst(solver.getBooleanSort(), "x")
+ solver.assertFormula(x.eqTerm(x))
+ solver.checkSat()
+ solver.blockModelValues([x])
def test_set_info(solver):
with pytest.raises(RuntimeError):