-
Notifications
You must be signed in to change notification settings - Fork 11
Home
CorC is an editor to construct algorithms following the Correctness-by-Construction approach. The information flow implementation is explained on the following site CorC. The Web application of CorC is available at: https://www.isf.cs.tu-bs.de/WebCorC/
Correctness-by-Construction (CbC) is an approach to incrementally create correct programs. Guided by pre-/postcondition specications, a program is created using refinement rules, guaranteeing the resulting implementation is correct. We implemented a graphical and textual IDE to create programs following the CbC approach. Starting with an abstract specification, our tool supports CbC developers to refine a program by a sequence of refinement steps and to verify the correctness of these refinement steps using a theorem prover.
To install the CorC tool, you can use the update site or install the plugins in this repository. Eclipse Modeling Tools in the version Neon or newer is required https://www.eclipse.org/downloads/eclipse-packages/.
- Check out the de.tu_bs.cs.isf.cbc.tool.update plugin
- In Eclipse Help > Install new software > Add... > Local > Navigate to the update site
- Select all features and continue the installation
-
Check out all plugins from the master branch
-
In de.tu-bs.cs.isf.cbc.model and in de.tu-bs.cs.isf.taxonomy.model
Open File [...].genmodel
Generate Model, Edit and Editor code -
Install dependencies manually:
In Eclipse Help > Install new software
Search and install Graphiti SDK Plus
In Eclipse Help > Eclipse Marketplace
Search and install JaMoPP
Search and install Eclipse Xtext
Visit https://www.key-project.org/download/ and follow the introductions to install KeY (KeY-Based Eclipse Projects) -
Create a second Eclipse Application configuration to use the editor
Instead of 3. the Installation with update site can be used, but only select the feature DependenciesFeature
New graphical editor files can be created by right clicking in the explorer New > Other > CorC > new CorC File > Next > CorC diagram and [name] and [path] > Finish
New textual editor files can be created by right clicking in the explorer New > Other > CorC > new CorC File > Next > CorC textual and [name] and [path] > Finish
The functionality of the editor can be seen in the following screencasts:
In this video, a linear search algorithm is constructed and proven in the graphical editor
https://raw.githubusercontent.com/TUBS-ISF/CorC/master/Screencasts/GraphicalLinearSearch.mp4
If this is too long, a smaller example is shown here.
https://raw.githubusercontent.com/TUBS-ISF/CorC/master/Screencasts/GraphicalSimpleExample.mp4
An example in textual editor is shown here.
https://raw.githubusercontent.com/TUBS-ISF/CorC/master/Screencasts/TextualSimpleExample.mp4
To prove a program in the graphical editor, you have to right click the concrete statement, a repetition statement, or a selection statement and choose Verify > Verify.... The shown helper.key file has to be created manually to specify specific predicates. Instead of predicates, Java methods can also be used in specification and code in the editor. The Java class has to be in the src-folder of the project. https://raw.githubusercontent.com/TUBS-ISF/CorC/master/Screencasts/GraphicalProve.mp4
To prove a program in the textual editor, you have to save the file and the KeY-problem-files are automatically generated. By selecting the files and pressing VerifyStatements in the tool bar, the proof starts automatically. In the editor, right click > Verification shows unproven statements. As in the graphical editor, helper methods and predicates have to be defined manually.
https://raw.githubusercontent.com/TUBS-ISF/CorC/master/Screencasts/TextualProve.mp4
To get from the graphical to the textual editor: right click > Edit > Generate textual representation
https://raw.githubusercontent.com/TUBS-ISF/CorC/master/Screencasts/GraphicalToTextual.mp4
To get from the textual to the graphical editor: Select the associated cbcmodel file of the textual editor and press GenerateGraphical in the tool bar.
https://raw.githubusercontent.com/TUBS-ISF/CorC/master/Screencasts/TextualToGraphical.mp4