Published June 23, 2023 | Version v0
Conference paper Open

Model Predictive Runtime Verification for Cyber-Physical Systems with Real-Time Deadlines

  • 1. Google LLC
  • 2. Iowa State University
  • 3. IBM Corporation

Description

Artifact Evaluation Submission for

Model Predictive Runtime Verification for Cyber-Physical Systems with Real-Time Deadlines

Pei Zhang, Alexis Aurandt, Rohit Dureja, Phillip H. Jones, and Kristin Yvonne Rozier

06/22/2023

  • Abstract

The AEP demonstrates the key contribution, which is the proof of concept of how we simulate the behavior of the quadcopter and apply the Model Predictive Runtime Verification (MPRV) to the system to predict the system failure in advance. This AEP is basically a work-through of reproducing Fig. 9 in the paper. Users can also play with different MLTL formulas and prediction steps to see how the result will be different. The AEP also produces the results for generating Fig. 11. 

  •  What the AEP doesn’t not contain

The AEP doesn’t contain the hardware code (.vhd) for the MPRV hardware. The detailed hardware usage report (Fig. 10) is highly dependent on the compiler tool chain, which can be generated from the EDA tool we use called `Vivado`. In this paper, we focus on the proof of concept of MPRV instead of the hardware design.

  • Architecture of AEP

The AEP is encapsulated in a docker image, which can be pulled from the docker hub: https://hub.docker.com/repository/docker/peii/mprv or download from Zenodo. The main code a located under /app folder. Below is the folder tree view:

/app

├── Dockerfile

├── MIT License

└── files/

    ├── ACOW/

    ├── admm_time_resource/

    ├── dataProcessing/

    └── quadcopter_dynamic_mpc.py


There are four main components:

1) ACOW (key component): 

MLTL formula compiler. Scripts in the folder help compile the MLTL into an abstract syntax tree and report the SCQ size, WCET etc.. It also produces the verification results (in the form of execution sequence in the paper) given the trace and the prediction length.

2) admm_time_resource: 

Script to report the theoretical resource usage and timing of model predictor (ADMM algorithm).

3) dataProcessing:

Scripts use the result generated from ACOW component and produce the Fig. 9 in the paper. The tool is mainly used for generating the pdf with custom latex texts and colors in the pdf figure.

4) quadcopter_dynamic_mpc.py:

Simulator of nonlinear model of the quadcopter with MPC controller. It generates quadcopter dynamic traces for ACOW for verification.

 

  • How to run

Prerequisite: Install the docker engine with CLI from here: https://docs.docker.com/engine/install/.

 

1. Download the docker zip file mprv-aep.tar. Load the docker image into the the system:

docker load -i mprv-aep.tar

2. Start the docker session:

docker run --platform linux/amd64 --name mprv-session -it mprv-docker:latest

This will start the docker session and enter the prompt.

3. Simulate the dynamic of quadcopter:

In the docker session prompt, type

cd /app/files/  && python quadcopter_dynamic_mpc.py &&  cp /app/files/plot.pickle /app/files/dataProcessing/predGraph

This step produces the plot.pickle data (python protocol data involves the quadcopter positions, speed, angles and planned trajectory) for ACOW to verify. Users can tune the quadcopter parameters in the script to see different dynamics.

4. Generate MPRV results in the form of execution sequence based on different MLTL formulas. The input is plot.pickle from step 3:

cd /app/files/ACOW/ && sh autogenpickler.sh

For simplicity, the MLTL formulas we used in the paper are hard-coded in autogenpicker.sh script. You can check the shell script for the details about how we use ACOW to produce MPRV results. In the terminal, you will see how each MLTL formula is parsed into an abstract tree and what is the output of the execution sequence (we only output execution sequence with False verdict for easy reading). Those execution sequence information is saved into .pickle and will be used for drawing the verdict/time in bottom 3 subfigures in Fig. 9 later.

This step also copies the execution sequence result (also in form of .pickle file) for the next step to draw figures.

5. Draw the result figure in Fig 9:

cd /app/files/dataProcessing/predGraph && python draw_result.py

This script will consume all the execution sequence data produced in step 4 and produce the figure. It handles the text position, colors,  and subfigure positions etc. with some hard-coded parameters. This step is not related to the MPRV concept. You should see the pdf figure generated in /app/files/dataProcessing/predGraph/res_mprv.pdf

To open the pdf, you need to copy the figure out of the docker session. Open another terminal and type:

(out of docker)

docker cp mprv-session:/app/files/dataProcessing/predGraph/res_mprv.pdf ./

Then you should be able to open the pdf file to view.

6. Draw the result in Fig. 11:

>> cd /app/files/admm_time_resource/ && python time_and_resource.py
This step is independent of step 1~5. Users can check how the resource and execution time scales up with the system size in the script. It will produce the figure /app/files/admm_time_resource/res_admm.pdf. You can copy it out to view like we mentioned how to copy files out of the docker session in step 5:

(out of docker)

docker cp mprv-session:/app/files/admm_time_resource/res_admm.pdf ./

 

Notes

Supported by NSF:CPS Award 2038903

Files

Files (4.8 GB)

Name Size Download all
md5:ec8995b948ec14e779524defa4ef3bc6
4.8 GB Download