diff --git a/pkg/ds/interfaces.go b/pkg/ds/interfaces.go index 3fa54cd..153ac30 100644 --- a/pkg/ds/interfaces.go +++ b/pkg/ds/interfaces.go @@ -46,18 +46,19 @@ type Product[S1 Set[S1], S2 Set[S2]] interface { // Partitions returns a slice of pairs such that, for (p Product): // p.Equal(Union(CartesianPairLeft(s1, s2) for _, (s1, s2) := range p.Partitions()) // (note that the order is arbitrary; we do not return HashSet because Pair is not Hashable) + // Partitions returns a slice of pairs in the product set (note that the order is arbitrary) Partitions() []Pair[S1, S2] // NumPartitions returns len(Partitions()). It is different from Size() which should return the number of concrete pairs of elements. NumPartitions() int - // Left returns the projection of Product[S1, S2] on the set S1. If the product is empty, it returns the empty set. + // Left returns the left projection from pairs in the product set on S1, given input of an empty set in S1. Left(empty S1) S1 - // Right returns the projection of Product[S1, S2] on the set S2. If the product is empty, it returns the empty set. + // Right returns the right projection from pairs in the product set S2, given input of an empty set in S2. Right(empty S2) S2 - // Swap returns a new Product object, built from the receiver object, with left and right swapped + // Swap returns a new Product object, built from the input object, with left and right swapped. Swap() Product[S2, S1] } diff --git a/pkg/netset/connectionset_test.go b/pkg/netset/connectionset_test.go index ec83e27..d053591 100644 --- a/pkg/netset/connectionset_test.go +++ b/pkg/netset/connectionset_test.go @@ -1,11 +1,18 @@ +/* +Copyright 2023- IBM Inc. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + package netset_test import ( "testing" + "github.com/stretchr/testify/require" + "github.com/np-guard/models/pkg/connection" "github.com/np-guard/models/pkg/netset" - "github.com/stretchr/testify/require" ) func TestConnectionSetBasicOperations(t *testing.T) { @@ -36,5 +43,4 @@ func TestConnectionSetBasicOperations(t *testing.T) { // basic IsEmpty test require.False(t, conn1.IsEmpty()) require.True(t, netset.NewConnectionSet().IsEmpty()) - }