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

Method test_solver_push_pop

tests/test_z3_ported.py:853–863  ·  view source on GitHub ↗

Guide: push/pop for incremental solving.

(self, kernel)

Source from the content-addressed store, hash-verified

851 assert s.check() == sat
852
853 def test_solver_push_pop(self, kernel):
854 """Guide: push/pop for incremental solving."""
855 x = Int("x")
856 s = Solver()
857 s.add(x > 0)
858 s.push()
859 s.add(x < 0)
860 assert s.check() == unsat
861 s.pop()
862 # Only x > 0 remains: not contradictory
863 assert s.check() != unsat
864
865 def test_solver_nested_push_pop(self, kernel):
866 """Multiple push/pop levels."""

Callers

nothing calls this directly

Calls 6

addMethod · 0.95
pushMethod · 0.95
checkMethod · 0.95
popMethod · 0.95
IntFunction · 0.90
SolverClass · 0.90

Tested by

no test coverage detected