github.com/hasnat/dolt/go@v0.0.0-20210628190320-9eb5d843fbb7/libraries/doltcore/sqle/setalgebra/doc.go (about)

     1  // Copyright 2020 Dolthub, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  /*
    16  Package setalgebra provides the ability to perform algebraic set operations on mathematical sets built directly on noms
    17  types. Unlike standard sets in computer science, which define a finitely sized collection of unordered unique values,
    18  sets in mathematics are defined as a well-defined collection of distint objects. This can include infinitely sized
    19  groupings such as the set of all real numbers greater than 0.
    20  
    21  See https://en.wikipedia.org/wiki/Set_(mathematics)
    22  
    23  There are 3 types of sets defined in this package: FiniteSet, Interval, and CompositeSet.
    24  
    25  FiniteSet is your typical computer science set representing a finite number of unique objects stored in a map. An
    26  example would be the set of strings {"red","blue","green"}, or the set of numbers {5, 73, 127}.
    27  
    28  Interval is a set which can be written as an inequality such as {n | n > 0} (set of all numbers n such that n > 0) or a
    29  chained comparison {n | 0.0 <= n <= 1.0 } (set of all floating point values between 0.0 and 1.0)
    30  
    31  CompositeSet is a set which is made up of a FiniteSet and one or more non overlapping intervals such as
    32  {n | n < 0 or n > 100} (set of all numbers n below 0 or greater than 100) this set contains 2 non overlapping intervals
    33  and an empty finite set. Alternatively {n | n < 0 or {5,10,15}} (set of all numbers n below 0 or n equal to 5, 10 or 15)
    34  which would be represented by one Interval and a FiniteSet containing 5,10, and 15.
    35  
    36  There are 2 special sets also defined in this package: EmptySet, UniversalSet.
    37  
    38  The EmptySet is a set that has no values in it.  It has the property that when unioned with any set X, X will be the
    39  result, and if intersected with any set X, EmptySet will be returned.
    40  
    41  The UniversalSet is the set containing all values.  It has the property that when unioned with any set X, UniversalSet is
    42  returned and when intersected with any set X, X will be returned.
    43  */
    44  package setalgebra