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

Function And

lean_py/z3/core.py:1308–1320  ·  view source on GitHub ↗
(*args: BoolRef)

Source from the content-addressed store, hash-verified

1306
1307
1308def And(*args: BoolRef) -> BoolRef:
1309 if len(args) == 1 and isinstance(args[0], list):
1310 args = tuple(args[0])
1311 if len(args) == 0:
1312 return BoolVal(True)
1313 if len(args) == 1:
1314 return args[0]
1315 merged: frozenset[tuple[str, ASTSort]] = frozenset().union(*(a._vars for a in args))
1316 # Build left-associated And chain
1317 ast: ASTNode = args[0]._ast
1318 for a in args[1:]:
1319 ast = BinOpNode(BinOp.AND, ast, a._ast)
1320 return BoolRef(ast, merged)
1321
1322
1323def Or(*args: BoolRef) -> BoolRef:

Callers 15

checkMethod · 0.90
add_ruleMethod · 0.90
queryMethod · 0.90
_applyMethod · 0.90
as_exprMethod · 0.90
test_and_or_notMethod · 0.90
test_demorgan_proofMethod · 0.90
test_demorgan2_proofMethod · 0.90
test_xor_definitionMethod · 0.90
test_modus_ponensMethod · 0.90

Calls 3

BinOpNodeClass · 0.90
BoolValFunction · 0.85
BoolRefClass · 0.85

Tested by 15

test_and_or_notMethod · 0.72
test_demorgan_proofMethod · 0.72
test_demorgan2_proofMethod · 0.72
test_xor_definitionMethod · 0.72
test_modus_ponensMethod · 0.72
test_dependency_chainMethod · 0.72
test_is_logical_opsMethod · 0.72