This repository contains the implementation and experimental setup for evaluating the Learning Symbolic Mealy Automata (LearningSMA) algorithm. The experiments include both practical case studies with real-world models and random experiments with varying parameters.
- Java JDK 8
- Maven
src/main/java/experiment/
: Contains the Java source code for the experimentsRandomGenerator.java
: Generates random Symbolic Mealy Automata for experimentspractical/
: Contains implementations of practical case studies- Various directories with random experiment implementations
lib/
: Contains the required JAR fileslearningsma-1.0-SNAPSHOT.jar
: The LearningSMA implementationmodels-1.0.jar
: Models used in the experiments
- Shell scripts for running experiments:
practical_experiment.sh
: Runs the full practical experimentsrandom_experiment.sh
: Runs the full random experimentsreproduce_practical_experiment.sh
: Reproduces the practical experimentssubset_practical_experiment.sh
: Runs a subset of the practical experimentssubset_random_experiment.sh
: Runs a subset of the random experiments
experiment-result.ipynb
: Jupyter notebook for analyzing and visualizing the results
The practical experiments use two real-world models:
- Mars Helicopter: A model of the Mars helicopter control system with 5 states
- Gear Shift: An automatic transmission gear shift controller with 16 states
The random experiments generate automata with varying parameters:
- Number of states: 10, 20, 40, or 80
- Alphabet size (SigmaE): 10, 20, 30, or 40
# Clean and build the project
mvn clean install
### Full Experiment Reproduction
To run the full set of experiments (this may take several hours to days depending on your hardware):
```bash
# For practical experiments (runs each model 10 times)
./practical_experiment.sh
# For random experiments (runs all configurations with multiple iterations)
./random_experiment.sh
For a quicker evaluation with a subset of the experiments (recommended for initial testing):
# For a subset of practical experiments (runs each model once)
./subset_practical_experiment.sh
# For a subset of random experiments (runs fewer configurations)
./subset_random_experiment.sh
The experiment results are stored in the following directories:
- Practical experiments:
practical_experiment_log/
- Random experiments: In their respective directories under
src/main/java/experiment/
You can analyze the results using the experiment-result.ipynb
notebook, which calculates:
- Average number of equivalence queries
- Average number of output queries
- Average run time
- Average sizes of R, SigmaE, and E sets
The notebook also generates plots showing the relationship between:
- Number of states and number of output queries
- Alphabet size and number of output queries
The full experiments run all test cases with multiple iterations to ensure statistical significance. This process is comprehensive but time-consuming.
-
Ensure Maven is installed and configured
-
Run the full practical experiment:
./practical_experiment.sh
This will:
- Compile all Java files in the practical directory
- Execute each practical model 10 times
- Store logs in the
practical_experiment_log
directory
-
Run the full random experiment:
./random_experiment.sh
This will:
- Generate random automata with various configurations
- Run learning experiments on each generated automaton
- Store results in their respective directories
For quicker evaluation or initial testing, you can run a subset of the experiments:
-
For practical experiments:
./subset_practical_experiment.sh
This runs each practical model once instead of 10 times.
-
For random experiments:
./subset_random_experiment.sh
This runs a smaller set of random configurations with fewer iterations.
After running the experiments, you can analyze the results:
- Open the
experiment-result.ipynb
notebook using Jupyter - Run all cells to generate statistics and plots
- The notebook will calculate averages for all metrics and generate visualizations
This implementation is based on the LearningSMA algorithm for learning Symbolic Mealy Automata. The practical models (Mars Helicopter and Gear Shift) represent real-world control systems with symbolic inputs and outputs.