MathPHP\SetTheory\Set::isProperSuperset PHP Метод

isProperSuperset() публичный Метод

Superset (A ⊇ B & A ≠ B) Is the set a superset of the other set? In other words, does the the set contain all the elements of the other set, and the set is not the same set as the other set?
public isProperSuperset ( Set $B ) : boolean
$B Set
Результат boolean
    public function isProperSuperset(Set $B) : bool
    {
        $B_array = $B->asArray();
        $A∩B = array_intersect_key($this->A, $B_array);
        $A∖B = array_diff_key($B_array, $this->A);
        return count($A∩B) === $B->length() && empty($A∖B) && $this != $B;
    }

Usage Example

Пример #1
0
 /**
  * @dataProvider dataProviderForIsProperSet
  */
 public function testIsProperSuperset(array $A, array $B)
 {
     $setA = new Set($B);
     $setB = new Set($A);
     $this->assertFalse($setA->isProperSuperset($setB));
 }