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

Clock reduction #8

Closed
wants to merge 30 commits into from
Closed
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
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
9930711
query
t-lohse Oct 20, 2022
1d70bcf
fix optional
t-lohse Oct 20, 2022
9451850
proto
t-lohse Oct 20, 2022
f99477b
proto
t-lohse Oct 20, 2022
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
69 changes: 55 additions & 14 deletions objects.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,63 @@ 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 SpecificComponent {
string component_name = 1;
uint32 component_index = 2;
}

message ComponentClock {
SpecificComponent specific_component = 1;
string clock_name = 2;
}

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

message Conjunction {
repeated Constraint constraints = 1;
}

message Disjunction {
repeated Conjunction conjunctions = 1;
}

message Federation {
Disjunction disjunction = 1;
}

message Location {
string id = 1;
SpecificComponent specific_component = 2;
}

message LocationTuple {
repeated Location locations = 1;
}

message State {
LocationTuple location_tuple = 1;
Federation federation = 2;
}

message DecisionPoint {
State source = 1;
repeated Edge edges = 2;
}

message StateTuple {
message LocationTuple {
string name = 1;
// Maybe the component name? or some comp id?
}
LocationTuple location = 1;
repeated Zone federation = 2;
message Edge {
string id = 1;
SpecificComponent specific_component = 2;
}

message Transition {
// Figure out what we need here
// repeated Edge edges = 1; //?
message Decision {
State source = 1;
Edge edge = 2;
}
106 changes: 75 additions & 31 deletions query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,95 @@ message IgnoredInputOutputs {
repeated string ignored_outputs = 2;
}

message Query {
int32 id = 1;
string query = 2;
IgnoredInputOutputs ignored_input_outputs = 3;
}
message QueryRequest { repeated Query queries = 1; }

message ComponentsUpdateRequest {
repeated Component components = 2;
int32 etag = 3; // hash
message UserTokenResponse {
int32 user_id = 1;
}

message QueryResponse {
Query query = 1;
message QueryRequest {
int32 user_id = 1;
int32 query_id = 2;
string query = 3;
ComponentsInfo components_info = 4;
IgnoredInputOutputs ignored_input_outputs = 5;
bool should_reduce_clocks = 6;
}

message RefinementResult {
bool success = 1;
repeated StateTuple relation = 2;
message QueryResponse {
oneof response {
QueryOk query_ok = 1;
UserTokenError user_token_error = 2;
}

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

oneof result {
RefinementResult refinement = 3;
ComponentResult component = 4;
ConsistencyResult consistency = 5;
DeterminismResult determinism = 6;
string error = 7;
ImplementationResult implementation = 8;
message QueryOk {
int32 query_id = 1;

message RefinementResult {
bool success = 1;
repeated State relation = 2;
string reason = 3;
State state = 4;
}

message ComponentResult { Component component = 1; }
message ConsistencyResult {
bool success = 1;
string reason = 2;
State state = 3;
}
message DeterminismResult {
bool success = 1;
string reason = 2;
State state = 3;
}
message ImplementationResult {
bool success = 1;
string reason = 2;
State state = 3;
}
message ReachabilityResult {
bool success = 1;
string reason = 2;
State state = 3;
repeated Edge edges = 4;
}

oneof result {
RefinementResult refinement = 3;
ComponentResult component = 4;
ConsistencyResult consistency = 5;
DeterminismResult determinism = 6;
string error = 7;
ImplementationResult implementation = 8;
ReachabilityResult reachability = 9;
}
message Information {
string subject = 1;
string message = 2;
}
repeated Information info = 10;
}
}

message UserTokenError {
int32 user_id = 1;
string error_message = 2;
}

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;
DecisionPoint new_decision_point = 1;
}

message SimulationInfo {
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);
}