-
Notifications
You must be signed in to change notification settings - Fork 1
User Interaction Sketches
Brief: Constructing an interval (not necessarily on the Reals) which may or may not be countable.
Basic flow:
- Construct a given interval with lower and upper limits, bounds and a logical indicating if countable
Pseudo-code:
Interval$new(1, 10, "()", countable = TRUE) # == 1,2,3,4,5,6,7,8,9,10
Interval$new(-Inf, Inf, "()", countable = FALSE) # Default
Brief: Constructing a set, of ANY type
Basic flow:
- Construct a set with given elements
Pseudo-code:
Set$new(1,2,3,4) # Set of numerics
Set$new("A","B","C") # Set of characters
Set$new(Set$new(1), 2, "A") # Set of sets and other types
Brief: Constructing a tuple, inheriting from Set, of ANY type
Basic flow:
- Construct a tuple with given ordered elements
Pseudo-code:
Tuple$new(1,2,3,4) # Set of numerics
Tuple$new("A","B","C") # Set of characters
Tuple$new(Set$new(1), 2, "A") # Set of sets and other types
Tuple$new(1,2,3,4) != Tuple$new(3,1,2,4) # Set$new(1,2,3,4) == Set$new(3,1,2,4)
Brief: Constructing a FuzzySet, inheriting from Set, of ANY type
Basic flow:
- Construct a FuzzySet with given elements and membership
- Query inclusion with
support, core, alphaCut
Pseudo-code:
f <- FuzzySet$new(c(1,0.1), c(2,0.9), c(3,0), c(4,1)) # FuzzySet with fully, partially and non-included elements
f$support() # 1,2,4
f$core() # 4
f$alphaCut(0.5) # 2, 4
Brief: Constructing one of the implemented special sets
Basic flow:
- Construct an implemented special set
Pseudo-code:
Reals$new()
Empty$new()
PosIntegers$new()
Brief: Perform manipulation of sets with basic operations including intersection, union, complement
Basic flow:
- Construct two or more SetIntervals (of same type)
- Use S3 dispatch to construct new SetIntervals dependent on operation
Pseudo-code:
x <- Set$new(1,2,3,4,5)
y <- Set$new(4,5,6,7,8)
union(x, y) == x + y # Set$new(1,2,3,4,5,6,7,8) # Maybe x | y
complement(x, y) == x - y # Set$new(1,2,3)
complement(x) # Exists only if a universe in x is defined
product(x, y) == x * y # Set$new(Set$new(1,4),Set$new(1,5),...,Set$new(5,8))
intersection(x, y) == x & y # Set$new(4, 5)
power(x, 2) == x^2 # Set$new(1,2,3,4,5, dim = 2)
union(x, Empty$new()) == x
intersection(x, x$universe()) == x
union(x, complement(x)) == x$universe()
intersection(x, complement(x)) == Empty$new()
x$powerSet()
Brief: After constructing a SetInterval, query for properties and traits
Basic flow:
- Construct a set, tuple or interval
- Query for properties or traits
Pseudo-code:
Reals$new()$properties()
Reals$new()$traits()
Reals$new()$countable() # Trait
Reals$new()$bounds() # Trait
Reals$new()$cardinality() # Trait
Reals$new()$universe() # Trait
Set$new(1,2)$countable() # Trait
Set$new(1,2)$cardinality() # Property
Interval$new(1,2)$bounds() # Property
Interval$new(1,2, universe = Reals)$universe() # Property
Brief: After constructing a SetInterval, query for min, max, sup, inf
Basic flow:
- Construct a set, tuple or interval
- Query for bounds
Pseudo-code:
Reals$new()$min()
Reals$new()$max()
Reals$new()$inf()
Reals$new()$sup()
Set$new(1,2,3)$min() == 1
Set$new("1",2,3)$min() == Error
Interval$new(1,5,type="[]")$min() == 1
Interval$new(1,5,type="[]")$inf() == 1
Interval$new(1,5,type="(]")$min() == 1 + 1.1e-15
Interval$new(1,5,type="(]")$inf() == 1
Brief: Construct a family of sets as an R6 list of sets
Basic flow:
- Construct two or more sets (or tuples or intervals)
- Construct a SetFamily
Pseudo-code:
x <- Set$new(1,2,3)
y <- Set$new(4,5,6)
SetFamily$new(list(x, y))
SetFamily$new(list(Set$new(1),Set$new(2)))
Brief: Construct sets and compare them, i.e. subsetting
Basic flow:
- Construct two or more sets (or tuples or intervals)
- Compare as subsets
Pseudo-code:
x <- Set$new(1,2,3,4,5,6)
y <- Set$new(4,5,6)
z <- x
x$isSubsetOf(y) == y <= x # TRUE
x$isSubsetOf(y, proper = TRUE) == y < x # TRUE
x$isSubsetOf(z) == z <= x # TRUE
x$isSubsetOf(z, proper = TRUE) == z < x # FALSE