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

Function If

lean_py/z3/core.py:1349–1360  ·  view source on GitHub ↗
(c: BoolRef, t: ExprRef, e: ExprRef)

Source from the content-addressed store, hash-verified

1347
1348
1349def If(c: BoolRef, t: ExprRef, e: ExprRef) -> ExprRef:
1350 merged: frozenset[tuple[str, ASTSort]] = frozenset().union(c._vars, t._vars, e._vars)
1351 ast = IteNode(c._ast, t._ast, e._ast)
1352 sort = t._sort
1353 # Return the appropriate subclass so arithmetic/comparison ops work
1354 if isinstance(t, ArithRef):
1355 return ArithRef(ast, sort, merged) # type: ignore[arg-type]
1356 if isinstance(t, BitVecRef):
1357 return BitVecRef(ast, sort, merged) # type: ignore[arg-type]
1358 if isinstance(t, BoolRef):
1359 return BoolRef(ast, merged)
1360 return ExprRef(ast, sort, merged)
1361
1362
1363def Distinct(*args: ExprRef) -> BoolRef:

Callers 15

_applyMethod · 0.90
test_ite_constructionMethod · 0.90
test_abs_via_iteMethod · 0.90
test_max_via_iteMethod · 0.90
test_min_via_iteMethod · 0.90
test_ite_childrenMethod · 0.90
test_if_then_elseMethod · 0.90
test_ite_true_branchMethod · 0.90
test_ite_false_branchMethod · 0.90

Calls 5

IteNodeClass · 0.90
ArithRefClass · 0.85
BitVecRefClass · 0.85
BoolRefClass · 0.85
ExprRefClass · 0.85

Tested by 15

test_ite_constructionMethod · 0.72
test_abs_via_iteMethod · 0.72
test_max_via_iteMethod · 0.72
test_min_via_iteMethod · 0.72
test_ite_childrenMethod · 0.72
test_if_then_elseMethod · 0.72
test_ite_true_branchMethod · 0.72
test_ite_false_branchMethod · 0.72
test_ite_ground_trueMethod · 0.72