Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8ca17e7
Merge pull request #1 from OpenModelica/test
lenaRB Oct 7, 2025
5c27948
Merge branch 'lenaRB:main' into main
lenaRB Oct 7, 2025
e97a566
Merge branch 'lenaRB:main' into main
lenaRB Oct 14, 2025
bbb8341
Create language_specification
lenaRB Oct 14, 2025
ce80248
CRML specification
lenaRB Oct 14, 2025
120e28c
Update README.md
lenaRB Oct 14, 2025
f59d86f
Delete CRML specification_v1.2.pdf
lenaRB Oct 14, 2025
17461ca
Add files via upload
lenaRB Oct 14, 2025
9b45c54
Update README.md
lenaRB Oct 14, 2025
3ebbd9e
Merge pull request #6 from OpenModelica/test
audrey-jardin Oct 20, 2025
597be2e
Merge branch 'lenaRB:main' into main
lenaRB Oct 23, 2025
4286061
Merge pull request #10 from OpenModelica/test
lenaRB Oct 23, 2025
a2800fb
example for library import
audrey-jardin Nov 24, 2025
bc60dab
some fixes to sets, get tests partially working again
lenaRB Nov 26, 2025
a9aa96a
Merge branch 'lenaRB:main' into main
lenaRB Nov 26, 2025
947414d
fix integration number of parameters
lenaRB Dec 4, 2025
7e5d857
published traffic light example
audrey-jardin Dec 4, 2025
e8aedee
working on sets
lenaRB Jan 4, 2026
dd36554
supporting sets
lenaRB Mar 19, 2026
945e40c
Merge branch 'lenaRB:main' into main
lenaRB Mar 20, 2026
b3be74d
Merge pull request #15 from OpenModelica/12-provide-a-use-case-to-tes…
lenaRB Mar 20, 2026
1521b12
Merge pull request #14 from OpenModelica/test
lenaRB Mar 20, 2026
66ba677
fix junit test path
lenaRB Mar 20, 2026
e50ec26
Update README.md
lenaRB Mar 20, 2026
ca2013b
Update README.md
lenaRB Mar 26, 2026
4b2a715
Update README.md
lenaRB Mar 26, 2026
6a8ef6d
repository restructure and clean up
lenaRB Mar 26, 2026
1f400b2
- libraries moved
lenaRB Apr 2, 2026
a76f31c
fix #39
adrpo Apr 2, 2026
a1cf947
Merge pull request #41 from OpenModelica/UpdateModelicaLibPlaces
adrpo Apr 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# this is just an example, we should create .mos
# files for each .mo file to run each as a JUnit test
# load the library
echo 'loadFile("./resources/modelica_libraries/CRMLtoModelica.mo"); getErrorString();' >> runTests.mos
echo 'loadFile("./libraries/modelica/CRMLtoModelica.mo"); getErrorString();' >> runTests.mos
# load a translated file
echo 'loadFile("./build/testSuiteGenerated/spec-doc-examples/BooleanAccumulation/BooleanAccumulation.mo"); getErrorString();' >> runTests.mos
# check the translated file
Expand Down
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
# crml-compiler
# crml compiler

A POC compiler from CRML to Modelica. For questions contact lena.buffoni at liu.com


## Download it via github actions

Go to: [![Makefile CI](https://github.com/lenaRB/crml-compiler/actions/workflows/makefile.yml/badge.svg)](https://github.com/lenaRB/crml-compiler/actions/workflows/makefile.yml) then click on the last green action and download the artifact.
Go to: [![Makefile CI](https://github.com/OpenModelica/CRML/actions/workflows/makefile.yml/badge.svg)](https://github.com/OpenModelica/CRML/actions/workflows/makefile.yml) then click on the last green action and download the artifact.

Unzip it to some place and run:
```
java -jar crml-compiler-all.jar --help
```
To see all the help flags and configurations

To run the test suite:
```
java -jar crml-compiler-all.jar --testsuite
```
A directory generated/ will be created and for each crml
test in the directory above a Modelica file will be created
in the generated/ directory.

## Build on Linux & MacOS
To build and run the tests of the parser on the crml files
```
# build the parser/translator and run the tests
make
# to clean the repository
make clean
```
## Build

You can use gradle to build the project from scratch.


## VSCode plugin

[project repoisotry](https://github.com/lenaRB/crml-vscode)


## Build on Windows
To build and run the tests of the parser/translator on the crml files
```
project-run.bat
REM to clean call: project-clean.bat
```

# CRML specification

The documentation for CRML can be found [HERE](https://github.com/lenaRB/crml-compiler/tree/main/language_specification)
The documentation for CRML can be found [HERE](./CRML_specification_v1.2.pdf)
Binary file not shown.
17 changes: 17 additions & 0 deletions documentation/embrace-website/homepage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html>
<head>
<title>Embrace project</title>
</head>
<body>
<p>The next industrial revolution is evident in the combination of renewables,
electric mobility and connected objects. The proper operation of complex systems requires
cooperation between all stakeholders from the start of system design and all along the engineering
lifecycle. The EMBrACE project will provide a user-friendly open environment for the co-design of
CPS based on a common requirements modelling language, so that requirements can be easily understood,
used to verify and optimise the system design, and ensure that the system design is robust in the face
of real-life physical and economic constraints and uncertainties.</p>
<p>The project resulted in the CRML specification and compiler and the OMSimulator simulation tools. </p>

</body>
</html>
1 change: 1 addition & 0 deletions documentation/resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# List of CRML related publications and research material
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,15 @@ end cvBooleanToBoolean4;

end ClockAdd;

model setAnd

input Types.Boolean4 [:] r1;

output Types.Boolean4 out;
equation

end setAnd;




Expand Down
8 changes: 6 additions & 2 deletions resources/crml_tutorial/traffic_light/Spec_simplified.crml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
//model TrafficLightSpecification is flatten ETLlibrary union {

model TrafficLightSpecification is {
// Requirement model for the traffic light example



// User-defined types and operators
// Definition of Requirement type
//Type Requirement is Boolean;
Expand Down Expand Up @@ -34,7 +38,7 @@ model TrafficLightSpecification is {
// Operators for the evaluation of requirements
// Check
Operator [ Boolean ] 'check' Boolean phi 'over' Periods P
= and ('evaluate' phi 'over' P);
= and ('evaluate' phi 'over' P.element);

// Category c1 is Category increasing1
//= { (>, >), (>=, >=), (<, >=), (<=, >), (==, >), (<>, >) };
Expand Down Expand Up @@ -64,7 +68,7 @@ model TrafficLightSpecification is {
// Checking that the number of event occurrences at the end of a time period is lower or higher than a threshold
// Option 1: without category
Operator [ Boolean ] Periods P 'check count' Clock E '==' Integer n
= 'check'(('count' E 'inside' P) == n) 'over' P;
= 'check'(('count' E 'inside' P.element) == n) 'over' P;

// // Option 2 (later support): with category
// Operator [ Boolean ] Periods P 'check count' Clock E '==' Integer n
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
model TrafficLightSpecification_article is
// Import of libraries
flatten {ETL, FORM_L}
union {
// List of external variables
Boolean red is external;
Boolean yellow is external;
Boolean green is external;

Boolean operation is external;
Boolean night_mode is external;
Boolean day_mode is not night_mode;

// Definition of requirements
// req0: "During operation, no more than one light should be on (a flashing mode could be specified later)"
Boolean{} lights is {red, yellow, green};
Integer n_lights_on is card { filter lights (element == true) };

Requirement req0 is
('during' operation) ('check anytime' (n_lights_on <= 1) );

// Day_mode
// req1: "After green, next step is yellow"
Requirement req1 is
(( 'after' ( green 'becomes true' ) 'before' ( yellow 'becomes true' )) while day_mode)
('check count' (red 'becomes true') '==' 0);

// req2: "Step green should stay active for at least 30 seconds"
Requirement req2 is
(( 'after' (green 'becomes true') 'for' 30) while day_mode)
('ensure' green);

// req3: "After green becomes active + 30 seconds, next step should turn yellow within 0.2 seconds"
Requirement req3 is
(( 'after' (green 'becomes true' + 30) 'for' 0.2) while day_mode)
('check at end' yellow);

// Night_mode
// req4: "During night, yellow should only be used"
Requirement req4 is
('during' night_mode)
('check count' ( (red or green) 'becomes true') '==' 0);
// req5: "During night, yellow should flash every 2 seconds"
Requirement req5a is
('during' night_mode)
('check count' ( yellow 'becomes true') '<>' 0);
Requirement req5b is
('after' ( yellow 'becomes true') 'within' 2) while night_mode)
('ensure' yellow);
Requirement req5c is
('after' ( yellow 'becomes true') 'for' 2) while night_mode)
('check at end' not yellow);
Requirement req5 is req5a and req5b and req5c;
};

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading