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

Method test_length_concat

tests/test_z3_semantic.py:733–736  ·  view source on GitHub ↗

len(a ++ b) = len(a) + len(b) for ground strings.

(self, kernel)

Source from the content-addressed store, hash-verified

731 assert _try_prove(Length(StringVal("")) == IntVal(0))
732
733 def test_length_concat(self, kernel):
734 """len(a ++ b) = len(a) + len(b) for ground strings."""
735 a, b = StringVal("foo"), StringVal("bar")
736 assert _try_prove(Length(StrConcat(a, b)) == Length(a) + Length(b))
737
738 def test_prefix_of(self, kernel):
739 assert _try_prove(PrefixOf(StringVal("ab"), StringVal("abc")))

Callers

nothing calls this directly

Calls 4

StringValFunction · 0.90
_try_proveFunction · 0.90
LengthFunction · 0.90
StrConcatFunction · 0.90

Tested by

no test coverage detected