Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The SW5 changes to protobuf along with futureproofing from the dev team #12

Merged
merged 47 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f3aec2c
Added the changes discussed in GRPC comittee
mads256h Oct 5, 2022
9401b2a
Change simulation api to support a stateless solution
CasperStaahl Oct 5, 2022
9212549
Change State to have a location_id instead of LocationTuple and unnes…
CasperStaahl Oct 6, 2022
4619ab6
Add UserTokenError
Archdragon79 Oct 7, 2022
c32d276
Merge pull request #5 from Ecdar-SW5/grpc-comittee-changes_stateless-…
lugialukas Oct 7, 2022
71baaad
Added string reason on results for some detail
Sigurd00 Oct 11, 2022
5b0edd2
Merge pull request #6 from Ecdar-SW5/query-response-details
CasperStaahl Oct 11, 2022
173c656
Add changes discussed with Sebastian
CasperStaahl Oct 12, 2022
d0e37a3
Update protocol as discussed by Sebastian
CasperStaahl Oct 12, 2022
4d15d86
Change objects.proto:
CasperStaahl Oct 12, 2022
f13e0b2
Remove unused message Transition
CasperStaahl Oct 13, 2022
92aa3cc
- Rename Zone to Federation, which is the correct term
CasperStaahl Oct 13, 2022
c5d9e4b
Add comment with alternative Simulation API
CasperStaahl Oct 13, 2022
890f245
Change to alternative simulation api, as dicussed with the GUI group
CasperStaahl Oct 14, 2022
d7438af
Format
CasperStaahl Oct 14, 2022
9256766
Merge branch 'grpc-comittee-changes' into grpc-comitte-changes_update…
CasperStaahl Oct 18, 2022
50e5b1d
Update query.proto
CasperStaahl Oct 18, 2022
e8fd380
Readd reason to quries
CasperStaahl Oct 18, 2022
e93c2b0
Fix indexes
CasperStaahl Oct 18, 2022
d6b7355
Remove commented code
CasperStaahl Oct 18, 2022
cea3465
Remove SimulationState message, was not in use
CasperStaahl Oct 19, 2022
506305d
Merge pull request #8 from Ecdar-SW5/grpc-comitte-changes_update-simu…
CasperStaahl Oct 19, 2022
ce77f23
Remove unused fields, readd edges toReachabilityResult
CasperStaahl Oct 19, 2022
9a6acd4
Revert "Remove unused fields, readd edges toReachabilityResult"
CasperStaahl Oct 19, 2022
476edf4
re-add edges to message ReachabilityResult
CasperStaahl Oct 19, 2022
c181269
Merge pull request #4 from Ecdar-SW5/grpc-comittee-changes
CasperStaahl Oct 19, 2022
21c0d2d
Added action string to determinism, consitency and refinement queries…
lass5588 Nov 9, 2022
f2e2308
Settings (#10)
t-lohse Nov 11, 2022
79d1da2
Clock settings refactor (#13)
t-lohse Nov 15, 2022
c48ba74
Clock settings (#14)
t-lohse Nov 17, 2022
22f7b52
group 17 reachability gRPC changes (#12)
Puvikaran2001 Nov 18, 2022
f41d85a
Simulation user id and nondeterminism for ambiguous edge choices.
CasperStaahl Nov 24, 2022
674a904
Merge pull request #16 from Ecdar-SW5/Simulation_API_update
CasperStaahl Nov 24, 2022
c1d41ac
Remove UserTokenError (#15)
mads256h Nov 25, 2022
31f6acb
action is now a repeated string, not a string!
mksm20 Nov 29, 2022
fa3ed0a
Merge pull request #17 from Ecdar-SW5/actionToVec
mksm20 Nov 30, 2022
e42e35d
Clock height (#18)
t-lohse Dec 5, 2022
f054b3e
Attempt to futureproof protobuf
seblund Feb 9, 2023
481c16f
Update failures to encompass the different ways that queries can fail
seblund Mar 1, 2023
a6d842f
Change location tuples to a tree structure to support simulation of q…
seblund Mar 1, 2023
7684645
Add destination state to all Decision structs
seblund Mar 3, 2023
2a1dbd3
Rename LocationBranch and SpecificComponent to better names
seblund Mar 10, 2023
f6a55b9
Merge pull request #13 from Ecdar/futureproof2
seblund Mar 10, 2023
676ab79
Rename Zero message to ZeroClock
seblund Mar 10, 2023
ae8364e
Remove federation message as it is just a wrapper. Disjunction is als…
seblund Mar 10, 2023
9b9ce8f
Update query.proto
Nielswps May 18, 2023
6fdef5f
Add full_state info to simulation step response (#14)
seblund Aug 23, 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
5 changes: 5 additions & 0 deletions component.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ message Component {
}
}

message ComponentsInfo {
repeated Component components = 1;
uint32 components_hash = 2;
}

/*
message Location {
string id = 1;
Expand Down
107 changes: 94 additions & 13 deletions objects.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,103 @@ option java_multiple_files = false;
option java_package = "EcdarProtoBuf";
option java_outer_classname = "ObjectProtos";

message Zone {
int32 dimensions = 1;
repeated int32 matrix = 2;
// Maybe include a lookup table for the indices?
import "component.proto";

message ComponentInstance {
string component_name = 1;
uint32 component_index = 2;
}

message StateTuple {
message LocationTuple {
string name = 1;
// Maybe the component name? or some comp id?
message Clock {
message ComponentClock {
ComponentInstance component_instance = 1;
string clock_name = 2;
}
message SystemClock {
uint32 clock_index = 1;
}
message ZeroClock {}
oneof clock {
// When a clock is attached to a component
ComponentClock component_clock = 1;
// When a clock is not attached to a component
SystemClock system_clock = 2;
// The zero clock (always has a valuation of 0)
ZeroClock zero_clock = 3;
}
LocationTuple location = 1;
repeated Zone federation = 2;
}

message Transition {
// Figure out what we need here
// repeated Edge edges = 1; //?

message Constraint {
// This message represents if (strict) { x - y < c } else { x - y <= c }
Clock x = 1;
Clock y = 2;
bool strict = 3;
int32 c = 4;
}

message Conjunction {
repeated Constraint constraints = 1;
}

message Disjunction {
repeated Conjunction conjunctions = 1;
}

// Should only be used when quotient adds new locations to the tree
enum SpecialLocation {
UNIVERSAL = 0;
ERROR = 1;
}

// A specific location in a specific component
message LeafLocation {
string id = 1;
ComponentInstance component_instance = 2;
}

// A combination/pair of locations separated by a binary operator (conjunction, composition, quotient, refinement)
message BinaryLocationOperator {
LocationTree left = 1;
LocationTree right = 2;
enum Operator {
CONJUNCTION = 0;
COMPOSITION = 1;
QUOTIENT = 2;
REFINEMENT = 3;
}
Operator operator = 3;
}

// A binary tree describing a location in a system. It has to be a tree to support the special locations from quotients
message LocationTree {
oneof node_type {
LeafLocation leaf_location = 1;
BinaryLocationOperator binary_location_op = 2;
SpecialLocation special_location = 3;
}
}

message State {
LocationTree location_tree = 1;
Disjunction zone = 2;
}

message Edge {
string id = 1;
ComponentInstance component_instance = 2;
}

message Decision {
// Only one transition should be possible for the given state and action
State source = 1;
string action = 2;
// Only for GUI purposes
repeated Edge edges = 3;
// The state that is reached if this decision is taken. Only for GUI purposes.
State destination = 4;
}

message Path {
repeated Decision decisions = 1;
}
192 changes: 162 additions & 30 deletions query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,188 @@ option java_outer_classname = "QueryProtos";
import "component.proto";
import "objects.proto";

message IgnoredInputOutputs {
repeated string ignored_inputs = 1;
repeated string ignored_outputs = 2;
message UserTokenResponse {
int32 user_id = 1;
}

message Query {
int32 id = 1;
string query = 2;
IgnoredInputOutputs ignored_input_outputs = 3;
message QueryRequest {
int32 user_id = 1;
int32 query_id = 2;
string query = 3;
ComponentsInfo components_info = 4;

message Settings {
bool disable_clock_reduction = 1;
}

Settings settings = 6;
}
message QueryRequest { repeated Query queries = 1; }

message ComponentsUpdateRequest {
repeated Component components = 2;
int32 etag = 3; // hash
message StateAction {
State state = 1;
string action = 2;
}

message QueryResponse {
Query query = 1;
enum NoInitialState {
NO_INITIAL_STATE = 0;
}

message RefinementResult {
bool success = 1;
repeated StateTuple relation = 2;
message ActionFailure {
enum Relation {
NOT_SUBSET = 0;
NOT_DISJOINT = 1;
}
message ActionSet {
string system = 1;
repeated string actions = 2;
bool is_input = 3;
}
Relation failure = 2;
repeated ActionSet action_sets = 3;
}

message QueryResponse {
int32 query_id = 1;

message ComponentResult { Component component = 1; }
message ConsistencyResult { bool success = 1; }
message DeterminismResult { bool success = 1; }
message ImplementationResult { bool success = 1; }

message RefinementFailure {
string system = 1;

message RefinementStateFailure {
enum Unmatched {
DELAY = 0;
ACTION = 1;
}
Unmatched unmatched = 1;
StateAction state = 2;
}

oneof failure {
// The refinement failed for an action in a specific state
RefinementStateFailure refinement_state = 2;
// The refinement failed because this system was empty
string empty_system = 3;
// The refinement failed because the initial state was empty
NoInitialState no_initial_state = 4;
// The refinement failed because a child was inconsistent
ConsistencyFailure inconsistent_child = 5;
// The refinement failed because the actions mismatched
ActionFailure action_mismatch = 6;
}
}

message ConsistencyFailure {
string system = 1;
oneof failure {
// The consistency check failed because the initial state was empty
NoInitialState no_initial_state = 2;
// The consistency check failed because this state was not consistent
State failure_state = 3;
// The consistency check failed because the system is not deterministic
DeterminismFailure determinism = 4;
}
}

message DeterminismFailure {
string system = 1;
// The determinism check failed in this state for this action
StateAction failure_state = 2;
}

message ImplementationFailure {
string system = 1;
oneof failure {
// The determinism check failed in this state for this action
StateAction failure_state = 2;
// The implementation check failed because the system was not consistent
ConsistencyFailure consistency = 3;
}
}

message ModelFailure {
string system = 1;

oneof failure {
// The check failed because the actions mismatched
ActionFailure action_mismatch = 2;
// The check failed because a conjunction was not consistent
ConsistencyFailure inconsistent_conjunction = 3;
// Some other model failure
string other = 4;
}
}

message ReachabilityFailure {
enum Failure {
UNREACHABLE = 0;
}

Failure failure = 1;
}

message ReachabilityPath {
Path path = 4;
}

message Success {

}

message Error {
string error = 1;
}

message ParsingError {
string error = 1;
}

oneof result {
RefinementResult refinement = 3;
ComponentResult component = 4;
ConsistencyResult consistency = 5;
DeterminismResult determinism = 6;
string error = 7;
ImplementationResult implementation = 8;
Component component = 2;
ConsistencyFailure consistency = 3;
DeterminismFailure determinism = 4;
ImplementationFailure implementation = 5;
ReachabilityFailure reachability = 6;
RefinementFailure refinement = 7;
ReachabilityPath reachability_path = 8;

ParsingError parsing_error = 98;
ModelFailure model = 99;
Success success = 100;
Error error = 101;
}

message Information {
enum Severity {
INFO = 0;
WARNING = 1;
}
Severity severity = 1;
string subject = 2;
string message = 3;
}
repeated Information info = 200;
}

message SimulationStartRequest {
string system = 1; // e.g. "(A || B) && C" or "A<=B"
SimulationInfo simulation_info = 1;
}

message SimulationStepRequest {
StateTuple state = 1;
Transition transition = 2;
SimulationInfo simulation_info = 1;
Decision chosen_decision = 2;
}

message SimulationStepResponse {
StateTuple state = 1;
repeated Transition transitions = 2;
// The full state that is reached after the simulation step
State full_state = 2;
// Possible decisions for subsets of the full state
repeated Decision new_decision_points = 1;

}

message SimulationInfo {
int32 user_id = 1;
string component_composition = 2; // example: A || B || A
ComponentsInfo components_info = 3;
}
9 changes: 5 additions & 4 deletions services.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ option java_multiple_files = false;
option java_package = "EcdarProtoBuf";
option java_outer_classname = "ServiceProtos";

import "component.proto";
import "objects.proto";
import "query.proto";

import "google/protobuf/empty.proto";

service EcdarBackend {
rpc UpdateComponents(ComponentsUpdateRequest) returns (google.protobuf.Empty);
rpc SendQuery(Query) returns (QueryResponse);
rpc GetUserToken(google.protobuf.Empty) returns (UserTokenResponse);
rpc SendQuery(QueryRequest) returns (QueryResponse);

rpc StartSimulation(SimulationStartRequest) returns (SimulationStepResponse);
rpc TakeSimulationStep(SimulationStepRequest) returns (SimulationStepResponse);
}