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


3. 1
   equal determines if two sets are equal

 

logo

equal a1 a2 .. aN       where a1 a2 .. aN are set variables

equal a1 a2

equal

When specified by itself then the operation is performed on the object on top of the stack and the one that is one below it, then the result is pushed on the stack

equal  context  2  commu        ins:H_H_H  ret:context

●  Operator equal determines if two sets are equal

The equal operator compares if two datasets are equal. Two set variables are equal if and only of they have the same subgroups, the same elements, and their corresponding attributes are matching. The attributes can be selectively set using the ks command.

 

equal EXAMPLE

The following example shows the use of equal operator, we will consider adjusting the attributes ks vector and comparing the similarities between the datasets.

 

equal OPERATION

aspl WS1
    (load the WS1 workspace for this example)

①  aspl> a12 = f& a1 a2
    (get the elements intersection of a1 and a2 in a12)

②  aspl> a13 = f& a1 a3
    (get the elements intersection of a1 and a3 in a13)

③  aspl> equal a12 a13
    (check equality of the set a12 and a13)

④  aspl> looselyequal a12 a13
    (are the two set loosely equal, ignoring the group labels)

⑤  aspl> gU a12 a13
    (print the group union between a12 and a13)

⑥  aspl> ,gU a12 a13
    (labinate and print the group union between a12 and a13)

⑦  aspl> sim a12 a13
    (get the similarity between a12 a13)

⑧  aspl> sim`fflz a12 a13
    (get the similarity between a12 a13, consider the attributes of the elements)

⑨  aspl> ks
    (print the current ks vector)

⑩  aspl> ks chksum ppdd ffl
    (set the ks vector to chksum ppdd ffl)

⑪  aspl> equal a12 a13
    (check equality of the set a12 and a13)

⑫  aspl> looselyequal a12 a13
    (are the two set loosely equal, ignoring the group labels)

⑬  aspl> ,gU a12 a13
    (labinate and print the group union between a12 and a13)

⑭  aspl> sim a12 a13
    (get the similarity between a12 a13)

⑮  aspl> sim`fflz a12 a13
    (get the similarity between a12 a13, consider the attributes of the elements)

 

● SET EQUALITY and its Amplifiers

This equal can be amplified by prefixing it with amplification syntax shown in the following table:

       a yellow note
Equal  determines if two or more sets are equal 
mostlyEqual  determines if two or more sets are mostly equal 
looselyEqual  determines if two or more sets are loosely equal 
mostlyLooselyEqual  determines if two or more sets are mostly loosely equal 
noeattrEqual  determines if two or more sets (ignoring the attributes) are equal 
mostlyNoeattrEqual  determines if two or more sets (ignoring the attributes) are equal 
looselyNoeattrEqual  determines if two or more sets (ignoring the attributes) are mostly equal 
mostlyLooselyNoeattrEqual  determines if two or more sets (ignoring the attributes) are mostly loosely equal 
(C)2024 ASPL Inc.