ASPL Programming ver 1.00
© 2024 Bassem W. Jamaleddine


11-1

   ASPL by Examples

When you start ASPL for the first time, the interpreter starts with the initial default workspace TRIVIAL. However, the product is shipped with many other workspaces that can be loaded to show the power and usability of ASPL in processing grouped data in various cases. The group of data can vary from players tossing dice, to UNIX administrative data, to geometric data, etc. ASPL data grouping uses two containers: the "Grouping Functions Container" and the "Grouping Class Container". Refer to A Set Programming Language book for more information on these two containers.

The following chapter show some examples for using the ASPL interpreter. All examples in uses workspace that are available in the sample worskpace WORKSPACE1.

● Comparing Java JMX TX JDBC JAR Files

WORKSPACE JMXJAR DESCRIPTION:

This is workspace is used to show how to use ASPL set operators to compare Java JMX TX JDBC JAR files. In the tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

Comparing Java JMX TX JDBC JAR Files see SECTION 11.2.1 [Comparing Java JMX TX JDBC JAR Files]

 

● Partitioning Java JMX JAR Files

WORKSPACE JMXJAR2 DESCRIPTION:

This is workspace is used to show how to use ASPL set operators to compare Java JMX JAR files by using the partitioning set operators. In the tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

Partitioning Java JMX JAR Files see SECTION 11.3.1 [Partitioning Java JMX JAR Files]

 

● Comparing Java TX JAR Files

WORKSPACE TXJAR DESCRIPTION:

This is workspace is used to show how to use ASPL set operators to compare Java Transaction TX JAR files. In the tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

Comparing Java TX JAR Files see SECTION 11.4.1 [Comparing Java TX JAR Files]

 

● Group Operations on UNIX Filesystem

WORKSPACE WS1 DESCRIPTION:

This is workspace is used to show how to use ASPL set operators to compare files on your UNIX filesystem. In the tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

Group Operations on UNIX Filesystem see SECTION 11.5.1 [Group Operations on UNIX Filesystem]

 

● TIE OSCILATOR SIGNALS TO ATTRIBUTES

WORKSPACE SIGNALS DESCRIPTION:

This workspace demonstrates how you can tie oscillating signals to ASPL attributes.

TIE OSCILATOR SIGNALS TO ATTRIBUTES see SECTION 11.6.1 [TIE OSCILATOR SIGNALS TO ATTRIBUTES]

 

● RANDOM POLYGONS IN TWO 2D PLANES

WORKSPACE POLY2PLANES DESCRIPTION:

This workspace shows how to use ASPL operators to do contextual set operations on geometric data. Worspaces that have a name suffixed with GEO causes ASPL to switch it f& and f\ to do contextual set intersection and set difference according to contextual routines, here they are the GEOmetric routines. Read the ASPL book on how to create GEO workspaces. In this tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

RANDOM POLYGONS IN TWO 2D PLANES see SECTION 11.8.1 [RANDOM POLYGONS IN TWO 2D PLANES]

 

● RANDOM POLYGONS IN THREE 2D PLANES

WORKSPACE POLY3PLANES DESCRIPTION:

This workspace shows how to use ASPL operators to do contextual set operations on geometric data. Worspaces that have a name suffixed with GEO causes ASPL to switch it f& and f\ to do contextual set intersection and set difference according to contextual routines, here they are the GEOmetric routines. Read the ASPL book on how to create GEO workspaces. In this tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

RANDOM POLYGONS IN THREE 2D PLANES see SECTION 11.9.1 [RANDOM POLYGONS IN THREE 2D PLANES]

 

● RANDOM POLYGONS ON TWO SPHERES

WORKSPACE POLY2CLOUDS DESCRIPTION:

This workspace shows how to use ASPL operators to do contextual set operations on geometric data. Worspaces that have a name suffixed with GEO causes ASPL to switch it f& and f\ to do contextual set intersection and set difference according to contextual routines, here they are the GEOmetric routines. This workspace shows the power of ASPL set operators when performing operations on geometric data set. In this example we will call the GG function ggRPO2Sov() to create 170 polygons, namely triangles, on two spheres. The result is assigned to G12_170, and the labeling of the first sphere is G1, and of the second sphere is G2. We will split the resulting set variable G12_170 into two set variables G1 and G2: G1 contains the first sphere polygons, and G2 contains the second sphere polygons. We will call f& on G1 and G2 to get their intersects, and assign the result to G12. We will call f\ on G1 and G2 to get their difference, and assign the result to G1_2. We will call f\ on G2 and G1 to get their difference, and assign the result to G2_1. The merge operation shown below is not required with latest version of ASPL. The merge of a variable into itself will just add a GADg to the variable, but if it is not needed then spare the memory. Finally we will dump the GADg of the variables so that we can plot them with drawgad command. Read the ASPL book on how to create GEO workspaces. In this tutorial the 'aspl>' refers to the ASPL prompt, and the '#' refers to the shell prompt.

RANDOM POLYGONS ON TWO SPHERES see SECTION 11.10.1 [RANDOM POLYGONS ON TWO SPHERES]

 

● RANDOM POLYGONS ON THREE SPHERES

WORKSPACE POLY3CLOUDS DESCRIPTION:

This workspace shows how to use ASPL operators to do contextual set operations on geometric data. Worspaces that have a name suffixed with GEO causes ASPL to switch it f& and f\ to do contextual set intersection and set difference according to contextual routines, here they are the GEOmetric routines. This workspace shows the power of ASPL set operators when performing operations on geometric data set. In this example we will call the GG function ggRPO3Sov() to create 100 polygons, namely triangles, on three spheres. The result is assigned to S123_100, and the labeling of the spheres are S1, S2, and S3. We will split the resulting set variable S123_100 into three set variables S1, S2, and S3. We will call f& on S1 and S2 to get their intersects, and the result is pushed on the stack. We will call f& on S1 and S3 to get their intersects, and the result is pushed on the stack. We will call f& on S1 and S3 to get their intersects, and the result is pushed on the stack. We will call f& on S1 S2 S3 to get their intersects, and the result is pushed on the stack. We will pop the stack and assign the results to S123, S23, S13, S12, S23 respectively. Finally we will dump the GADg of the variables so that we can plot them with drawgad command. Read the ASPL book on how to create GEO workspaces. In this tutorial the 'aspl>' refers to the ASPL prompt, and the '#' refers to the shell prompt.

RANDOM POLYGONS ON THREE SPHERES see SECTION 11.11.1 [RANDOM POLYGONS ON THREE SPHERES]

 

● MONITORING UNIX SOCKET STATUS

WORKSPACE MONSOCKET DESCRIPTION:

This workspace shows how to monitor the state changes in the UNIX socket. This MONSOCKET workspace has the element grouping class SOCK. In this example a program is started with a socket listening on port 12345. Locate the process number of the program that opened the socket, eg. in here it is program whose process is 32036. The program process is treated as a group label, and the socket as an element of the group whose attributes are the socket attributes. We will create a variable sok12345, then we will interrogate the variable sok12345 seventeen times with a delay of one second. In the meantime on the system we start a client program to connect to opened socket of the process 32036. The client program writes to the opened socket. The changes in the state of the socket are being captured by ASPL in the variable sok12345. That is ASPL monitors the process number and update the ASPL variable sok12345.

MONITORING UNIX SOCKET STATUS see SECTION 11.12.1 [MONITORING UNIX SOCKET STATUS]

 

● WATER LEVEL BETWEEN BAY1 AND BAY2

WORKSPACE BAYS12MON DESCRIPTION:

This example shows how you can tie attributes to sensors and have an attribute with anonymous function to process the data collected by these tied attributes. In what follows, the ASPL commands are these that start with aspl> and the UNIX shell commands start with hash #

WATER LEVEL BETWEEN BAY1 AND BAY2 see SECTION 11.13.1 [WATER LEVEL BETWEEN BAY1 AND BAY2]