ASPL Programming ver 1.00
© 2024 Bassem W. Jamaleddine
4. 1f& get the elements intersection
f& a1 a2 [a3 .. aN] where a1 a2 [a3 .. aN] are set variables
f&`mtm~ a1 a2 [a3 .. aN]
f&/mtm~ a1 a2 [a3 .. aN]
f&
when specified by itself then get the intersection of object on top and one below the top of stack
setop setoid 2* notcommu ins:H_H_H ous:H_H_H
Use the f& operator to get the intersection between two set. This operation is commutative only if it is followed by two set variables and the setop is not ticked with a predicate. Obviously get the intesection of three or more sets then only the leftmost set will be in perspective to gather the intersecting elements with the other sets, and the operation cannot be commutative. In addition if a predicate is used then the opeation may be commutative depending on the predicate.
superset EXAMPLE1This example show the basic set operations using the superset operator.
① aspl> a123 = gU a1 a2 a3
② aspl> a12 = gU a1 a2
③ aspl> superset a123 a12 a1
④ aspl> superset a12 a1
⑤ aspl> superset a12 a2
superset OPERATION1This example show the basic set operations using the superset operator.
① aspl> a123 = gU a1 a2 a3
② aspl> a12 = gU a1 a2
③ aspl> superset a123 a12 a1
④ aspl> superset a12 a1
⑤ aspl> superset a12 a2
superset EXAMPLE2This example show the basic set operations using the superset operator.
① aspl> mostly
② aspl> mostly 20
③ aspl> mostlylooselysubset a2 a1
superset OPERATION2This example show the basic set operations using the superset operator.
① aspl> mostly
② aspl> mostly 20
③ aspl> mostlylooselysubset a2 a1
superset EXAMPLE3A set variable a1 is assigned to the group of files found in a directory. The content of the directory is being altered and you need to determine if some files has been added to or deleted from that directory.
① aspl> a1
② aspl> ? a1
③ aspl> superset a1 a1@1
④ aspl> subset a1 a1@1
superset OPERATIONTRASH TEMPLATE THAT NEEDS TO BE EDITED
① aspl> a12 = f& a1 a2
(a12 is assigned the intersection of a1 a2)
② aspl> display a12
(print out a12)
③ aspl> v a12
(view internals of set variable a12)
● Tickable Predicates for f&
This f& is tickable with predicates that are shown in the following table:
a yellow note
f&`_ get the elements intersection f&`c= get the elements intersection such that they have the same checksum f&`c~ get the elements intersection such that they have different checksums f&`c~~ get the elements intersection such that they have all over different checksums f&`h= get the elements intersection such that they have the same entropy f&`h~ get the elements intersection such that they have different entropies f&`h~~ get the elements intersection such that they have all over different entropies f&`mtm= get the elements intersection such that they have the same make time f&`mtm~ get the elements intersection such that they have different make times f&`mtm~~ get the elements intersection such that they have all over different make times f&`mtm< get the elements intersection such that they have a prior make time f&`mtm<= get the elements intersection such that they have prior or same make time f&`mtm> get the elements intersection such that they have more recent make time f&`mtm>= get the elements intersection such that they have more recent or same make time f&`ks= get the elements intersection such that they have the same ksum f&`ks~ get the elements intersection such that they have different ksums f&`ks~~ get the elements intersection such that they have all over different ksums