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

Function IsSubset

lean_py/z3/core.py:3686–3695  ·  view source on GitHub ↗

Check if a is a subset of b.

(a: ArrayRef, b: ArrayRef)

Source from the content-addressed store, hash-verified

3684
3685
3686def IsSubset(a: ArrayRef, b: ArrayRef) -> BoolRef:
3687 """Check if a is a subset of b."""
3688 sort = a._sort
3689 if not isinstance(sort, ArraySortRef):
3690 raise TypeError("IsSubset requires set (array) arguments")
3691 dom = sort.domain()
3692 i = Const("__iss_i", dom)
3693 a_i = BoolRef(SelectNode(a._ast, i._ast), _merge(a._vars, i._vars))
3694 b_i = BoolRef(SelectNode(b._ast, i._ast), _merge(b._vars, i._vars))
3695 return ForAll([i], Implies(a_i, b_i))
3696
3697
3698def SetHasSize(s: ArrayRef, n: int) -> BoolRef:

Callers 2

test_is_subsetMethod · 0.90
test_is_subsetMethod · 0.90

Calls 7

SelectNodeClass · 0.90
ConstFunction · 0.85
BoolRefClass · 0.85
_mergeFunction · 0.85
ForAllFunction · 0.85
ImpliesFunction · 0.85
domainMethod · 0.45

Tested by 2

test_is_subsetMethod · 0.72
test_is_subsetMethod · 0.72