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

Function SetComplement

lean_py/z3/core.py:3668–3678  ·  view source on GitHub ↗

Set complement via lambda.

(s: ArrayRef, ctx: Context | None = None)

Source from the content-addressed store, hash-verified

3666
3667
3668def SetComplement(s: ArrayRef, ctx: Context | None = None) -> ArrayRef:
3669 """Set complement via lambda."""
3670 sort = s._sort
3671 if not isinstance(sort, ArraySortRef):
3672 raise TypeError("SetComplement requires set (array) argument")
3673 dom = sort.domain()
3674 i = Const("__sc_i", dom)
3675 s_i = BoolRef(SelectNode(s._ast, i._ast), _merge(s._vars, i._vars))
3676 body = Not(s_i)
3677 lam = Lambda(i, body)
3678 return ArrayRef(lam._ast, sort, s._vars)
3679
3680
3681def SetDifference(a: ArrayRef, b: ArrayRef, ctx: Context | None = None) -> ArrayRef:

Callers 3

test_set_complementMethod · 0.90
test_set_complementMethod · 0.90
SetDifferenceFunction · 0.85

Calls 8

SelectNodeClass · 0.90
ConstFunction · 0.85
BoolRefClass · 0.85
_mergeFunction · 0.85
NotFunction · 0.85
LambdaFunction · 0.85
ArrayRefClass · 0.85
domainMethod · 0.45

Tested by 2

test_set_complementMethod · 0.72
test_set_complementMethod · 0.72