MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / test_solver_context_manager

Method test_solver_context_manager

tests/test_z3_ported.py:898–906  ·  view source on GitHub ↗

With statement for push/pop.

(self, kernel)

Source from the content-addressed store, hash-verified

896 assert len(s.assertions()) == 0
897
898 def test_solver_context_manager(self, kernel):
899 """With statement for push/pop."""
900 s = Solver()
901 x = Int("x")
902 s.add(x > 0)
903 with s:
904 s.add(x < 0)
905 assert s.check() == unsat
906 assert len(s.assertions()) == 1
907
908 def test_model_not_supported(self, kernel):
909 """model() raises since Lean is not an SMT solver."""

Callers

nothing calls this directly

Calls 5

addMethod · 0.95
checkMethod · 0.95
assertionsMethod · 0.95
SolverClass · 0.90
IntFunction · 0.90

Tested by

no test coverage detected