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

Function Product

lean_py/z3/core.py:1693–1706  ·  view source on GitHub ↗

Left-fold product.

(*args: ArithRef)

Source from the content-addressed store, hash-verified

1691
1692
1693def Product(*args: ArithRef) -> ArithRef:
1694 """Left-fold product."""
1695 flat: list[ArithRef] = []
1696 for a in args:
1697 if isinstance(a, (list, tuple)):
1698 flat.extend(a)
1699 else:
1700 flat.append(a)
1701 if not flat:
1702 return IntVal(1)
1703 result = flat[0]
1704 for a in flat[1:]:
1705 result = result * a
1706 return result
1707
1708
1709# ---------------------------------------------------------------------------

Callers 7

test_product_proofMethod · 0.90
test_product_variadicMethod · 0.90
test_product_emptyMethod · 0.90
test_productMethod · 0.90
test_product_emptyMethod · 0.90
test_product_proofMethod · 0.90
test_product_groundMethod · 0.90

Calls 1

IntValFunction · 0.85

Tested by 7

test_product_proofMethod · 0.72
test_product_variadicMethod · 0.72
test_product_emptyMethod · 0.72
test_productMethod · 0.72
test_product_emptyMethod · 0.72
test_product_proofMethod · 0.72
test_product_groundMethod · 0.72