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

Method test_select_store_same_index

tests/test_z3_compat.py:599–606  ·  view source on GitHub ↗

Store then Select at the same index gives the written value.

(self, kernel)

Source from the content-addressed store, hash-verified

597 assert isinstance(c._ast, ConstArrayNode)
598
599 def test_select_store_same_index(self, kernel):
600 """Store then Select at the same index gives the written value."""
601 a = Array("a", IntSort(), IntSort())
602 v = Int("v")
603 written = Store(a, IntVal(3), v)
604 read_back = Select(written, IntVal(3))
605 claim = ForAll([a, v], read_back == v)
606 assert _try_prove(claim)
607
608 def test_constant_array_read(self, kernel):
609 """Reading from a constant array gives the constant value."""

Callers

nothing calls this directly

Calls 8

ArrayFunction · 0.90
IntSortFunction · 0.90
IntFunction · 0.90
StoreFunction · 0.90
IntValFunction · 0.90
SelectFunction · 0.90
ForAllFunction · 0.90
_try_proveFunction · 0.90

Tested by

no test coverage detected