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

Function Length

lean_py/z3/core.py:2287–2291  ·  view source on GitHub ↗

String or sequence length.

(s: StringRef | SeqRef)

Source from the content-addressed store, hash-verified

2285
2286
2287def Length(s: StringRef | SeqRef) -> ArithRef:
2288 """String or sequence length."""
2289 if isinstance(s, SeqRef):
2290 return ArithRef(SeqLenNode(s._ast), IntSort(), s._vars)
2291 return ArithRef(StrLenNode(s._ast), IntSort(), s._vars)
2292
2293
2294def Contains(s: StringRef | SeqRef, t: StringRef | SeqRef) -> BoolRef:

Callers 10

test_string_lengthMethod · 0.90
test_lengthMethod · 0.90
test_seq_lengthMethod · 0.90
test_lengthMethod · 0.90
test_length_emptyMethod · 0.90
test_length_concatMethod · 0.90
test_length_nonnegMethod · 0.90

Calls 4

SeqLenNodeClass · 0.90
StrLenNodeClass · 0.90
ArithRefClass · 0.85
IntSortFunction · 0.85

Tested by 10

test_string_lengthMethod · 0.72
test_lengthMethod · 0.72
test_seq_lengthMethod · 0.72
test_lengthMethod · 0.72
test_length_emptyMethod · 0.72
test_length_concatMethod · 0.72
test_length_nonnegMethod · 0.72