ASPL Guide to Operations v 1.00
© 2024 by SetSphere.COM


4. 1
   f& gets the elements intersection

 

logo

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*  commu        ins:H_H_H  ous:H_H_H

●  Operator f& gets the elements intersection

Use the f& operator to get the intersection between two sets. This operation is commutative and associative, however these properties may not be valid if the operator is being ticketed with a predicate.

 

f& EXAMPLE1
In this example we start ASPL by loading the sample workspace RANDONEBITMIX and issue the operator f& to get the elements intersections of g1, g2, and g3. The set variables g1, g2, and g3 represents datasets of three randomly generated groups that have been saved in ASPL symbol table.

 

f& OPERATION1

aspl RANDONEBITMIX
    (start ASPL loading the sample workspace RANDONEBITMIX)

①  aspl> v
    (display the symbol table)

②  aspl> f& g1 g2 g3
    (display the intersections of the elements in groups g1 g2 g3)

③  aspl> f&`c= g1 g2 g3
    (display the intersections of the elements with different checksums in groups g1 g2 g3)

④  aspl> ,f&`c= g1 g2 g3
    (display the intersections of the elements with different checksums in groups g1 g2 g3)

Note that we labinate the operator by prefixing it with a comma.

 

f& and supersetness EXAMPLE2
In this example we will assign the intersections of the groups to set variables then we will perform some setness operations on these variables.

 

f& and supersetness OPERATION2

①  aspl> fi123 = f& g1 g2 g3
    (assign fi123 to the elements intersection between g1 g2 g3)

②  aspl> fi12 = f& g1 g2
    (assign fi12 to the elements intersection between g1 g2)

③  aspl> subset fi12 fi123
    (display subsetness between fi12 and fi123)

fi12 is not a proper subset because fi12 contains more elements

④  aspl> mostlysubset fi12 fi123
    (check subsetness using the mostly amplifier)

the two missmatching elements can be displayed

⑤  aspl> f\ fi12 fi123

of course the following will return an empty set

⑥  aspl> f\ fi123 fi12

but this does not mean that fi123 is a subset of fi12

⑦  aspl> subset fi123 fi12
    (display subsetness between fi123 and fu12)

and fi123 is not a supersubset of fi12 because it contains the two missmatching elements

⑧  aspl> superset fi123 fi12
    (display supersetness between fi123 and fu12)

you can display and inspect the difference between fi12 and fi123 using the labinated fU

⑨  aspl> ,fU fi12 fi123
    (labinate and display set union between fi12 fi123)

however if we get the union of the elements of g1 g2 g3 then the two missing elements are now in fu123

⑩  aspl> fu123 = fU g1 g2 g3
    (assign fu123 to the elements union of g1 g2 and g3)

and fi12 is a subset of fu123

⑪  aspl> subset fi12 fu123
    (display subsetness between fi12 and fu123)

 

f& ticked c~ EXAMPLE3

A set variable a1 is assigned to the group of files found in a directory. The directory has been accessed by some process. You need to determine if some files have been altered in that directory. So we interrogate the variable a1 while the process is running. After the process terminates execution, we can view the similarity of the archived set variable.

 

f& ticked c~ OPERATION3

aspl -wsname JUNK -groupingclass POSIX

①  aspl> a1 = ggdir(dir,/tmp/junkdir)

②  aspl> ?13,1 a1
    (interrogate the variable a1, loop 13 times with a delay of 1 second)

do some changes to any file or files in /tmp/junkdir, for instance edit and save any file, add or delete files, or touch any file.

③  aspl> v sorted
    (display the symbol table including the archived variables)

④  aspl> @ a1
    (display the variable a1 along its archived data)

⑤  aspl> @sim a1
    (display the similarity of a1 and its archives)

⑥  aspl> fD a1 a1@1
    (display the symmetric difference (new or deleted) files)

⑦  aspl> gD a1 a1@1
    (display the symmetric difference (new or deleted) files or directories)

⑧  aspl> ,f&`c~ a1 a1@1
    (display the files that have changes (checksums have been altered))

⑨  aspl> ,g&`c~ a1 a2
    (display the intersection of files and directories with different checksums)

notice that we labinate the operators by prefixing the operators with a comma.

 

● Tickable Predicates for f&

This f& is tickable with predicates that are shown in the following table:

       a yellow note
f&`_  gets the elements intersection 
f&`c=  gets the elements intersection such that they have the same checksum 
f&`c~  gets the elements intersection such that they have different checksums 
f&`c~~  gets the elements intersection such that they have all over different checksums 
f&`h=  gets the elements intersection such that they have the same entropy 
f&`h~  gets the elements intersection such that they have different entropies 
f&`h~~  gets the elements intersection such that they have all over different entropies 
f&`mtm=  gets the elements intersection such that they have the same make time 
f&`mtm~  gets the elements intersection such that they have different make times 
f&`mtm~~  gets the elements intersection such that they have all over different make times 
f&`mtm<  gets the elements intersection such that they have a prior make time 
f&`mtm<=  gets the elements intersection such that they have prior or same make time 
f&`mtm>  gets the elements intersection such that they have more recent make time 
f&`mtm>=  gets the elements intersection such that they have more recent or same make time 
f&`ks=  gets the elements intersection such that they have the same ksum 
f&`ks~  gets the elements intersection such that they have different ksums 
f&`ks~~  gets the elements intersection such that they have all over different ksums 
(C)2024 ASPL Inc.