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

Refactor for query results and failures, new protobuf protocol, fixing simulation/reachability #147

Merged
merged 56 commits into from
Apr 6, 2023

Conversation

seblund
Copy link
Member

@seblund seblund commented Mar 2, 2023

Large PR, sorry. Almost all changes depend on each other which resulted in changes all over the code base. I will do a walkthrough on request :)

Changes:

  • Update protobuf to support:
    • Simulation of all system types (Quotient works now)
    • Cause of failure for all query types with as much information as possible
  • Add nice result enum types for every query and cause of failure
  • Introduce intermediate types between protobuf structs and TransitionSystem related structs (State, LocationTuple, Federation, etc.) with conversions between them (proto <=> intermediate <=> ts ).
  • Basically rewrite simulation as the only complicated part is serialization/deserialization of states
  • Change reachability to use the same Decision structs as in simulation

Most of the changes were to be able to serialize and deserialize States (Hence also LocationTuple and Federation). There are tests to ensure that the proto <=> intermediate <=> ts relation holds for thousands of different States from various systems.

@seblund seblund requested a review from t-lohse March 3, 2023 15:37
Copy link
Contributor

@t-lohse t-lohse left a comment

Choose a reason for hiding this comment

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

I have a few comments, not much.

I noticed a few things that I think should be fixed/implemented/changed, but may be out of scope for this PR, such as the LocationTuple. Unless I have misunderstood it, I think we should rename it to LocationTree.
This is something I have noticed throughou Reveaal, some naming could be better. For example, if I'm not misunderstanding, a Componenent is the representation of the automaton? So why not just call it an Automaton? This way it would translate better to/from j-Ecdar. I think we should let it "slip" for this PR, and make a refactor issue.

Beyond that, I think it would be beneficial to have some documentation. Again, this is an issue throughout Reveaal, so maybe just make an issue? Personally, I think it's necessary to have documentation for public structs, enums, and functions, as well as "large", private helper functions, but I am not sure how much. Do you have any input?

Overall, very nice PR! 💪

src/DataReader/proto_reader.rs Outdated Show resolved Hide resolved
src/ProtobufServer/ecdar_requests/send_query.rs Outdated Show resolved Hide resolved
src/ProtobufServer/ecdar_requests/send_query.rs Outdated Show resolved Hide resolved
src/System/extract_state.rs Outdated Show resolved Hide resolved
src/System/local_consistency.rs Outdated Show resolved Hide resolved
src/System/query_failures.rs Outdated Show resolved Hide resolved
src/System/query_failures.rs Show resolved Hide resolved
src/System/reachability.rs Show resolved Hide resolved
src/System/refine.rs Outdated Show resolved Hide resolved
src/System/specifics.rs Outdated Show resolved Hide resolved
@seblund
Copy link
Member Author

seblund commented Mar 9, 2023

I have resolved the conversations that I have fixed with these commits.
I have also added documentation to all structs/enums/funcs in specifics.rs and query_failures.rs.

I have now added issues for documentation in general and for consistent naming of build_* methods :)

Copy link
Contributor

@t-lohse t-lohse left a comment

Choose a reason for hiding this comment

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

LGTM, very nice 😃

seblund and others added 2 commits March 18, 2023 20:00
* clock reduction fix

* removed component

* fmt

* rename

* Added tests, along with refactor

* refactored unwrap

* Fixed error with locations
@seblund seblund linked an issue Mar 30, 2023 that may be closed by this pull request
@seblund seblund merged commit a998584 into Ecdar-SW5/main Apr 6, 2023
@seblund seblund deleted the new_results_refactor branch April 6, 2023 15:32
seblund pushed a commit that referenced this pull request May 11, 2023
* started advanced cases

* start_find_redundant_clocks

* test setup, needs test examples

* test setup, needs test examples

* added test component

* added get_transition

* added test component for composition

* added test component, and refactored file system for test components

* Added find transition

* Refactor

* Name refactor

* Where implementations

* Some impl

* Fixed compile error

* Changed reduce_clocks prototype

* Miss merge

* added get_children_mut

* Hardcoded clock reduction of clock y

* Hardcoded clock reduction of clock y

* merge

* heights

* compile

* Test refactor

* Warnings

* working on clock reduction analyzer

* Some debugging

* Fixed Simon Deleuran Laursen's mistake

* Fixed tests

* Reduces

* updated tests

* Naming

* can make graph from cyclic components, and cyclic component added. Updated .gitignore to ignore .ds_store file (generated by macos)

* added guard dependencies to edges

* Refactor

* Test fix-ish

* Removes from updates

* Added invariant_dependencies to nodes and converted graph.nodes to a Hashmap instead of a Vec

* fixed unused clock detection test

* made clock reduction better

* fixed naming

* Fixed another test

* Refactor

* fixed another test

* Fix error

* merged advanced-clock-reduction

* removed unnecessary mut

* merged

* Refactor

* fixed tests

* added processing to json component

* added two test cases

* added comments to find_equivalent_clock_groups

* Fixed clock reduction tests in the simple cases

* helper functions

* fixed clock reduction

* Error handling

* fmt

* working on test_check_declarations_unused_clock_are_removed

* tiny refactor

* start testfunc

* Intersect

* Small fixes

* Fix removal

* Added clock removal test for unused and duplicated clocks & removed advanced clock reduction samples

* Fix warnings

* Fixed SystemRecipe.height

* Remove print

* Fmt

* Fixed comments

Co-authored-by: Simon Laursen <[email protected]>
Co-authored-by: Kira Stæhr Pedersen <[email protected]>
Co-authored-by: Alexander Steffensen <[email protected]>
Co-authored-by: alexsteffensen <[email protected]>
Co-authored-by: Jens Emil Fink Højriis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove state field from the reachability result
2 participants