ASPL User Guide v 1.00
© 2025 Bassem W. Jamaleddine


8. 1
   ASPL Checksum Set Operations

 

The following are the checksum set operators

cU c& c\ cD cP

Union on the checksum

      cU a1 a2 [a3 .. aN]       where a1 a2 [a3 .. aN] are set variables

Intersection on the checksum

      c& a1 a2

Difference on the checksum

      c\ a1 a2

Symmetric difference on the checksum

      cD a1 a2

Partition based on the checksum

      cP a1 a2

ASPL Checksum Set Operations

●  ASPL Checksum Set Operations

Grouping dataset elements based on the checksum of their attributes is realized with five operators: cU c& c\ cD cP. While some elements in a dataset may seem to be different then the others, however they can be categorized to be similar to the others if they have the same checksum. On the other hand, some elements in two datasets can be similar, yet they may differ in their checksums. The checksum operators make it easy for the ASPL user to reveal and to visualize the similarity between elements such as files, Java class names, and even outcomes of tossed dices, using simple command. Getting the intersection, the union, or the paritions of the elements with similar checksum can be realized with cU, c&, and cP operators respectively.

ASPL provides five operators to do checksum set operations: cU c& c\ cD cP

 

c& EXAMPLE
In this example we will compare the files between two directories based on their checksums. Files that have different names but they have the same checksums will be revealed. The checksum-intersection operation will reveal these files with the same contents even if they are located in different directories or have different names.

 

c& OPERATION

aspl WS1
    (start ASPL loading the sample workspace WS1 )

①  aspl> c& a1 a2
    (show the intersection between the datasets in a1 and a2 based on their element checksums)

The c& is the same as c*&

②  aspl> c*& a1 a2
    (show the intersection between the datasets in a1 and a2 based on their element checksums)

③  aspl> c&`mtm~ a1 a2
    (show the intersection between the datasets in a1 and a2 based on their element checksums whose mtimes are different)

 

cU Example
In this example we will compare the files between two directories based on their checksums. File with the different names but with same checksums will be revealed. The union operation of the checksums display all checksums and their corresponding file names.

 

cU Operation

aspl WS1
    (start ASPL loading the sample workspace WS1 )

①  aspl> c*U a1 a2
    (show the union of the checksums in the datasets a1 and a2)

The c*U is the same as cU

②  aspl> cU a1 a2
    (show the union of the checksums in the datasets a1 and a2)

③  aspl> cU`mtm~ a1 a2
    (show the union of the checksums in the datasets a1 and a2 whose mtimes are different)

 

cP EXAMPLE
The following example shows how to partition three directories based on their file checksums. To test with this operation, start ASPL by loading the sample workspace WS1 then we issue the cP operation.

 

cP OPERATION

aspl WS1

①  aspl> cP a3 a4 a5
    (partition a3 a4 a5 based on their element (or filename) checksums)

②  aspl> cP`mtm= a3 a4 a5
    (partition a3 a4 a5 based on their element (or filename) checksums such that the mtimes are equal)

③  aspl> cP`mtm~ a3 a4 a5
    (partition a3 a4 a5 based on their element (or filename) checksums such that the mtimes are unequal)

 

c\ EXAMPLE
In this example we will compare the files between two directories based on their checksums. File with the different names but with same checksums will be revealed. The difference of checksums display only these files with unequal checksums.

 

c\ OPERATION

aspl WS1
    (start ASPL loading the sample workspace WS1 )

①  aspl> c\ a1 a2
    (show the different checksums between the datasets in a1 and a2)

The c\ is the same as c*\

②  aspl> c*\ a1 a2
    (show the different checksums between the datasets in a1 and a2)

Notice that the `mtm~ is reverted to be as 'equal' since it is used in the context of the difference

③  aspl> c\`mtm~ a1 a2
    (show the different checksums between the datasets in a1 and a2 whose mtimes are the same)Notice that the `mtm= is reverted to be as 'unequal' since it is used in the context of the difference

④  aspl> c\`mtm= a1 a2
    (show the different checksums between the datasets in a1 and a2 whose mtimes are the different)

 

cD EXAMPLE
In this example we will compare the files between two directories based on their symmetric checksums. File with the different names but with same checksums will be revealed. The symmetric difference of checksums display only these files with unequal checksums.

 

cD OPERATION

aspl WS1
    (start ASPL loading the sample workspace WS1 )

①  aspl> cD a1 a2
    (show the symmetric difference checksums between the datasets in a1 and a2)

The cD is the same as c*D

②  aspl> c*D a1 a2
    (show the symmetric difference checksums between the datasets in a1 and a2)

Notice that the `mtm~ is reverted to be as 'equal' since it is used in the context of the difference

③  aspl> cD`mtm~ a1 a2
    (show the symmetric difference checksums between the datasets in a1 and a2 whose mtimes are the same)

Notice that the `mtm= is reverted to be as 'unequal' since it is used in the context of the difference

④  aspl> cD`mtm= a1 a2
    (show the symmetric difference checksums between the datasets in a1 and a2 whose mtimes are the different)