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

Method test_nested_push_pop

tests/test_z3_semantic.py:1086–1098  ·  view source on GitHub ↗
(self, kernel)

Source from the content-addressed store, hash-verified

1084 assert s.check() == sat
1085
1086 def test_nested_push_pop(self, kernel):
1087 x = Int("x")
1088 s = Solver()
1089 s.add(x == x) # tautology
1090 s.push()
1091 s.add(IntVal(1) == IntVal(1)) # tautology
1092 s.push()
1093 s.add(IntVal(1) == IntVal(2)) # contradiction
1094 assert s.check() == unsat
1095 s.pop()
1096 assert s.check() == sat # x == x ∧ 1 == 1
1097 s.pop()
1098 assert s.check() == sat # x == x
1099
1100 def test_reset_clears(self, kernel):
1101 s = Solver()

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected