Skip to content

Commit

Permalink
Updating the initial page to include information about both tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Garcia committed Apr 19, 2019
1 parent 8f6a04e commit f678797
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 364 deletions.
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# HyPLC: Hybrid Programmable Logic Controller Program Translation for Verification
# HyPLC: Hybrid Programmable Logic Controller Program Translation for Verification[1]
Programmable Logic Controllers (PLCs) provide a prominent choice of implementation platform for safety-critical industrial control systems. Formal verification provides ways of establishing correctness guarantees, which can be quite important for such safety-critical applications. But since PLC code does not include an analytic model of the system plant, their verification is limited to discrete properties. In this paper, we, thus, start the other way around with hybrid programs that include continuous plant models in addition to discrete control algorithms. Even deep correctness properties of hybrid programs can be formally verified in the theorem prover KeYmaera X that implements differential dynamic logic, dL, for hybrid programs. After verifying the hybrid program, we now present an approach for translating hybrid programs into PLC code. The new tool, **HyPLC**, implements this translation of discrete control code of verified hybrid program models to PLC controller code and, vice versa, the translation of existing PLC code into the discrete control actions for a hybrid program given an additional input of the continuous dynamics of the system to be verified. This approach allows for the generation of real controller code while preserving, by compilation, the correctness of a valid and verified hybrid program. PLCs are common cyber-physical interfaces for safety-critical industrial control applications, and HyPLC serves as a pragmatic tool for bridging formal verification of complex cyber-physical systems at the algorithmic level of hybrid programs with the execution layer of concrete PLC implementations.

Structured Text to Hybrid Program Translation
============
This is the half of the HyPLC tool that translates the IEC61131-3 standard structured text programming language for PLCs to a hybrid program specified in differential dynamic logic. This makes up one half of the HyPLC tool presented in [1]. For the converse translation, please visit the project link page. The tool has been directly integrated into the KeYmaera X command-line tool.
*README TODO: Add usage examples
##### Usage
You can use the hyplc-st-to-hp.py script to perform the translation for a given st file as follows:
* python3 ./hyplc-st-to-hp.py st-file [hp-file]
where <st-file> is a structured text program file that conforms to the subset of the IEC61131-3 standard defined in our paper, and <hp-file> is an option for providing a hybrid program where the ctrl can be replaced. This can be done by essentially writing a hybrid program as usual and including a placeholder "ctrl" variable where the ctrl of the system should reside.
![HyPLC System Overview](./docs/figures/hyplc-overview.jpg)

##### Usage
Each translation direction has its own implementation. For the translation of structured text to hybrid programs, please visit the **hyplc-st-to-hp** directory. For the details about the hybrid program to structured text translation implementation, please see the details in the **hyplc-hp-to-st** directory.

Installation
============
This project depends on ANTLR4 version 4.7.1 as well as Python3. Please note that ANTLR4 is very version-dependent.

Publications
============
Expand Down
11 changes: 11 additions & 0 deletions hyplc-hp-to-st/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Hybrid Program to Structured Text Translation
============
This repo simply is a placeholder until we integrate the the HP to ST command line option into the Github repo. Right now, the jar file in this repo is a runnable verasion of KeYmaera X that has the associated command line option (see STL). The tool takes as input the hybrid program in scan cycle normal form and generates a structured text program that preserves the semantics as well as any safety guarantees.


##### Usage
You can refer to the command line KeYmaera X usage information from the [KeYmaera X repo page.](https://github.com/LS-Lab/KeYmaeraX-release). The input will be a kyx file and hte output will

java -jar ./keymaerax.jar -genSTFile <model-file.kyx> -out file.st

The out file will be a structured text program.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions hyplc-st-to-hp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Structured Text to Hybrid Program Translation
============
This is the half of the HyPLC tool that translates the IEC61131-3 standard structured text programming language for PLCs to a hybrid program specified in differential dynamic logic. This makes up one half of the HyPLC tool presented in [1]. For the converse translation, please visit the project link page. The tool has been directly integrated into the KeYmaera X command-line tool.
*README TODO: Add usage examples
##### Usage
You can use the hyplc-st-to-hp.py script to perform the translation for a given st file as follows:
</br>
* python3 ./hyplc-st-to-hp.py st-file [hp-file]

where <st-file> is a structured text program file that conforms to the subset of the IEC61131-3 standard defined in our paper, and <hp-file> is an option for providing a hybrid program where the ctrl can be replaced. This can be done by essentially writing a hybrid program as usual and including a placeholder "ctrl" variable where the ctrl of the system should reside.


File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f678797

Please sign in to comment.