Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c64d052
WIP: ECDAR reference added, dependency section updated, and spelling …
Nielswps Feb 8, 2023
d20a900
WIP: Backend replaced with Engine to be consistent with naming
Nielswps Feb 8, 2023
0521d58
WIP: Engine Configuration enriched
Nielswps Feb 8, 2023
5541728
Contributing section added and code snippets updated to be executable…
Nielswps Feb 10, 2023
61b8963
Rename branched out from readme_update
Nielswps Feb 10, 2023
fc990cd
File used on other branch
Nielswps Feb 10, 2023
2a70993
WIP: ECDAR reference added, dependency section updated, and spelling …
Nielswps Feb 8, 2023
dc5c07d
WIP: Backend replaced with Engine to be consistent with naming
Nielswps Feb 8, 2023
62eb03d
Contributing section added and code snippets updated to be executable…
Nielswps Feb 10, 2023
ab6422f
File used on other branch
Nielswps Feb 10, 2023
764e7e1
Rebased with main
Nielswps Feb 23, 2023
afccbc2
WIP: Backend replaced with Engine to be consistent with naming
Nielswps Feb 8, 2023
848d83e
WIP: Engine Configuration enriched
Nielswps Feb 8, 2023
fbd3b17
File used on other branch
Nielswps Feb 10, 2023
36c2070
Merge branch 'backend_to_engine' of github.com:Nielswps/Ecdar-GUI int…
Nielswps Feb 23, 2023
8143573
Line about the deprecated mutation package added
Nielswps Feb 24, 2023
2aef3a3
Merged with main
Nielswps Mar 1, 2023
e78ad50
Update src/main/java/ecdar/abstractions/Query.java
Nielswps Mar 2, 2023
d85703e
WIP: Review changes (part 1/2)
Nielswps Mar 2, 2023
a2df214
Update src/main/java/ecdar/backend/BackendHelper.java
Nielswps Mar 2, 2023
c5b4c42
Merge branch 'backend_to_engine' of github.com:Nielswps/Ecdar-GUI int…
Nielswps Mar 2, 2023
f047d48
WIP: Review changes (part 2/2)
Nielswps Mar 2, 2023
c3301cb
startedEngineConnections filtering added to only account for ports of…
Nielswps Mar 3, 2023
56287c2
Found some more strings and vars to update
Nielswps Mar 3, 2023
1358d72
Review suggestions implemented
Nielswps Mar 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This project is a hard fork of https://github.com/ulriknyman/H-Uppaal.
This section covers what dependencies are currently needed by the GUI.

### JVM
As with all Java applications, a working JVM is required to run the project.
As with all Java applications, a working JVM is required to run the project.

You will need Java version 11 containing JavaFX. We suggest downloading Azul's Java 11 from https://www.azul.com/downloads/?version=java-11-lts&package=jdk-fx, as this is the version used by the main development team.

Expand Down Expand Up @@ -53,15 +53,15 @@ After having retrieved the code and acquired all the dependencies mentioned in [

<a id="engine_configuration"></a>
## Engine Configuration
In order to utilize the model-checking capabilities of the system, at least one engine must be configured.
In order to utilize the model-checking capabilities of the system, at least one engine must be configured.
The distributions available at [ECDAR](https://github.com/Ecdar/ECDAR) will automatically load the default engines on startup, but this is currently not working when running the GUI through Gradle.
For the same reason, the `Reset Engines` button will clear the engines but will not be able to load the packaged once.

An engine can be added through the configurator found under `Options > Engines Options` in the menubar, which opens the pop-up shown below.

<img src="presentation/EngineConfiguration.png" alt="Engine Configuration Pop-up">

> :information_source: If you accidentally removed or changed an engine, these changes can be reverted be pressing `Cancel` or by clicking outside the pop-up. Consequently, if any changes should be saved, **MAKE SURE TO PRESS `Save`**
> :information_source: If you accidentally removed or changed an engine, these changes can be reverted be pressing `Cancel` or by clicking outside the pop-up. Consequently, if any changes should be saved, **MAKE SURE TO PRESS `Save`**

### Address
The _Address_ is either the address of a server running the engine (for remote execution) or a path to a local engine binary (for this, the _Local_ checkbox must be checked).
Expand All @@ -75,7 +75,7 @@ If an engine is marked with _Default_, all added queries will be assigned that e


## Exemplary Projects
To get started and get an idea of what the system can be used for, multiple examples can be found in the `examples` directory.
To get started and get an idea of what the system can be used for, multiple examples can be found in the `examples` directory.
These projects include preconfigured models and queries to execute against them.

For the theoretical background and what the tool can be used for, please check out the latest research links at [here](https://ulrik.blog.aau.dk/ecdar/).
Expand All @@ -93,7 +93,7 @@ Pull requests are continuously being reviewed and merged. In order to ease this

Additionally, please add `Closes #{ISSUE_ID}` if the pull request is linked to a specific issue. If a PR addresses multiple pull requests, please add `Closes #{ISSUE_ID}` for each one.

A CI workflow is executed against all pull requests and must succeed before the pull request can be merged, so please make sure that you check the workflow status and potential error messages.
A CI workflow is executed against all pull requests and must succeed before the pull request can be merged, so please make sure that you check the workflow status and potential error messages.

### Tests
All non-UI tests are executed as part of the CI workflow and hence must succeed before merging. The tests are written with JUnit and relevant tests should be added when new code is added. If you are new to JUnit, you can check out syntax and structure [here](https://junit.org/junit5/docs/current/user-guide/).
Expand All @@ -103,7 +103,7 @@ The test suite can be executed locally by running:
./gradlew test
```

> :information_source: Currently, the codebase has high coupling, which has made testing difficult and the test suite very small.
> :information_source: Currently, the codebase has high coupling, which has made testing difficult and the test suite very small.

#### UI Tests
For features that are highly coupled with the interface, a second test suite has been added under `src/test/java/ecdar/ui`. These tests are excluded from the `test` task are can be executed by running:
Expand Down Expand Up @@ -154,4 +154,4 @@ Besides the packages mentioned above, some larger functionalities are located in
- `code_analysis`: Responsible for analysing the elements of the current project and construct messages if errors or warnings are encountered.
- `issues`: Classes for representing `Errors`, `Issues`, and `Warnings`.
- `model_canvas.arrow_heads`: Arrowheads used in the UI to visualize the direction of edges.

- `mutation [Deprecrated]`: Functionality for supporting mutation testing of components. **This feature is currently not implemented in the engines and is therefor currently not supported**.
6 changes: 3 additions & 3 deletions examples/AGTest/Queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "refinement: ((A1 || G2) \\ A2) \u003c\u003d G1",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "refinement: ((A1 || G1) \\ A2) \u003c\u003d Imp",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
}
]
12 changes: 6 additions & 6 deletions examples/CarAlarm/Model/Queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,46 @@
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "specification: Alarm",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "reachability: Alarm.L11",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "reachability: Alarm.L12",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "reachability: Alarm.L9",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "specification: (Alarm: A[] not Alarm.L7 || Alarm.x\u003c\u003d30)",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
}
]
10 changes: 5 additions & 5 deletions examples/EcdarUniversity/Queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "specification: Spec",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "consistency: (Administration || Machine || Researcher)",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "consistency: (Administration || Machine || Researcher)",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "refinement: (Administration || Machine || Researcher) \u003c\u003d Spec",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
}
]
2 changes: 1 addition & 1 deletion examples/FishRetailer/Model/Queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
}
]
6 changes: 3 additions & 3 deletions examples/SenderReceiver/Queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "specification: Sender",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
},
{
"query": "implementation: Sender",
"comment": "",
"isPeriodic": false,
"ignoredInputs": {},
"ignoredOutputs": {},
"backend": "Reveaal"
"engine": "Reveaal"
}
]
Binary file removed presentation/EngineConfiguration.png
Binary file not shown.
8 changes: 4 additions & 4 deletions src/main/java/ecdar/Ecdar.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public void start(final Stage stage) {
BackendHelper.stopQueries();

try {
backendDriver.closeAllBackendConnections();
backendDriver.closeAllEngineConnections();
} catch (IOException e) {
e.printStackTrace();
}
Expand All @@ -310,11 +310,11 @@ public void start(final Stage stage) {
System.exit(0);
});

BackendHelper.addBackendInstanceListener(() -> {
// When the backend instances change, re-instantiate the backendDriver
BackendHelper.addEngineInstanceListener(() -> {
// When the engines change, re-instantiate the backendDriver
// to prevent dangling connections and queries
try {
backendDriver.closeAllBackendConnections();
backendDriver.closeAllEngineConnections();
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import ecdar.utility.serialize.Serializable;
import javafx.beans.property.SimpleBooleanProperty;

public class BackendInstance implements Serializable {
public class Engine implements Serializable {
private static final String NAME = "name";
private static final String IS_LOCAL = "isLocal";
private static final String IS_DEFAULT = "isDefault";
Expand All @@ -16,14 +16,14 @@ public class BackendInstance implements Serializable {
private String name;
private boolean isLocal;
private boolean isDefault;
private String backendLocation;
private String engineLocation;
private int portStart;
private int portEnd;
private SimpleBooleanProperty locked = new SimpleBooleanProperty(false);

public BackendInstance() {};
public Engine() {};

public BackendInstance(final JsonObject jsonObject) {
public Engine(final JsonObject jsonObject) {
deserialize(jsonObject);
};

Expand Down Expand Up @@ -51,12 +51,12 @@ public void setDefault(boolean aDefault) {
isDefault = aDefault;
}

public String getBackendLocation() {
return backendLocation;
public String getEngineLocation() {
return engineLocation;
}

public void setBackendLocation(String backendLocation) {
this.backendLocation = backendLocation;
public void setEngineLocation(String engineLocation) {
this.engineLocation = engineLocation;
Comment on lines +58 to +59
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not entirely sure but is engineLocation a path to a executable?
Maybe we should do some validation on this argument eg. checking if the location points to an executable file.
Also, I think that the engine location maybe should be stored as a File and then getEngineLocation could return the absolute path to the file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The engineLocation can refer to both an executable and a remote IP address. The validation you suggest is done when the engine is constructed through the GUI (as this allows for error messages to be displayed at an appropriate time and node)
We basically assume that the location is valid at the time we get here, as it is stored as a string within the local preferences. Maybe adding some validation here could be a good idea if we start adding engines through other workflows, but the current setup makes it extraneous.

}

public int getPortStart() {
Expand All @@ -76,7 +76,7 @@ public void setPortEnd(int portEnd) {
}

public int getNumberOfInstances() {
return this.portEnd - this.portStart;
return this.portEnd - this.portStart + 1;
}

public void lockInstance() {
Expand All @@ -93,7 +93,7 @@ public JsonObject serialize() {
result.addProperty(NAME, getName());
result.addProperty(IS_LOCAL, isLocal());
result.addProperty(IS_DEFAULT, isDefault());
result.addProperty(LOCATION, getBackendLocation());
result.addProperty(LOCATION, getEngineLocation());
result.addProperty(PORT_RANGE_START, getPortStart());
result.addProperty(PORT_RANGE_END, getPortEnd());
result.addProperty(LOCKED, getLockedProperty().get());
Expand All @@ -106,7 +106,7 @@ public void deserialize(final JsonObject json) {
setName(json.getAsJsonPrimitive(NAME).getAsString());
setLocal(json.getAsJsonPrimitive(IS_LOCAL).getAsBoolean());
setDefault(json.getAsJsonPrimitive(IS_DEFAULT).getAsBoolean());
setBackendLocation(json.getAsJsonPrimitive(LOCATION).getAsString());
setEngineLocation(json.getAsJsonPrimitive(LOCATION).getAsString());
setPortStart(json.getAsJsonPrimitive(PORT_RANGE_START).getAsInt());
setPortEnd(json.getAsJsonPrimitive(PORT_RANGE_END).getAsInt());
if (json.getAsJsonPrimitive(LOCKED).getAsBoolean()) lockInstance();
Expand Down
23 changes: 11 additions & 12 deletions src/main/java/ecdar/abstractions/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import ecdar.Ecdar;
import ecdar.backend.*;
import ecdar.controllers.EcdarController;
import ecdar.utility.helpers.StringValidator;
import ecdar.utility.serialize.Serializable;
import com.google.gson.JsonObject;
import javafx.application.Platform;
Expand All @@ -15,15 +14,15 @@ public class Query implements Serializable {
private static final String QUERY = "query";
private static final String COMMENT = "comment";
private static final String IS_PERIODIC = "isPeriodic";
private static final String BACKEND = "backend";
private static final String ENGINE = "engine";

private final StringProperty query = new SimpleStringProperty("");
private final StringProperty comment = new SimpleStringProperty("");
private final StringProperty errors = new SimpleStringProperty("");
private final SimpleBooleanProperty isPeriodic = new SimpleBooleanProperty(false);
private final ObjectProperty<QueryState> queryState = new SimpleObjectProperty<>(QueryState.UNKNOWN);
private final ObjectProperty<QueryType> type = new SimpleObjectProperty<>();
private BackendInstance backend;
private Engine engine;


private final Consumer<Boolean> successConsumer = (aBoolean) -> {
Expand Down Expand Up @@ -61,7 +60,7 @@ public Query(final String query, final String comment, final QueryState querySta
this.query.set(query);
this.comment.set(comment);
this.queryState.set(queryState);
setBackend(BackendHelper.getDefaultBackendInstance());
setEngine(BackendHelper.getDefaultEngine());
}

public Query(final JsonObject jsonElement) {
Expand Down Expand Up @@ -118,12 +117,12 @@ public void setIsPeriodic(final boolean isPeriodic) {
this.isPeriodic.set(isPeriodic);
}

public BackendInstance getBackend() {
return backend;
public Engine getEngine() {
return engine;
}

public void setBackend(BackendInstance backend) {
this.backend = backend;
public void setEngine(Engine engine) {
this.engine = engine;
}

public void setType(QueryType type) {
Expand Down Expand Up @@ -153,7 +152,7 @@ public JsonObject serialize() {
result.addProperty(QUERY, getType().getQueryName() + ": " + getQuery());
result.addProperty(COMMENT, getComment());
result.addProperty(IS_PERIODIC, isPeriodic());
result.addProperty(BACKEND, backend.getName());
result.addProperty(ENGINE, engine.getName());

return result;
}
Expand All @@ -176,10 +175,10 @@ public void deserialize(final JsonObject json) {
setIsPeriodic(json.getAsJsonPrimitive(IS_PERIODIC).getAsBoolean());
}

if(json.has(BACKEND)) {
setBackend(BackendHelper.getBackendInstanceByName(json.getAsJsonPrimitive(BACKEND).getAsString()));
if(json.has(ENGINE)) {
setEngine(BackendHelper.getEngineByName(json.getAsJsonPrimitive(ENGINE).getAsString()));
} else {
setBackend(BackendHelper.getDefaultBackendInstance());
setEngine(BackendHelper.getDefaultEngine());
}
}

Expand Down
Loading