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

[K-Improvement] Create Ordering instance for Sentence's subclasses #3530

Closed
Robertorosmaninho opened this issue Jul 21, 2023 · 6 comments · Fixed by #3590 or #3670
Closed

[K-Improvement] Create Ordering instance for Sentence's subclasses #3530

Robertorosmaninho opened this issue Jul 21, 2023 · 6 comments · Fixed by #3590 or #3670
Assignees

Comments

@Robertorosmaninho
Copy link
Collaborator

Robertorosmaninho commented Jul 21, 2023

Motivation

We may need in the future to sort all sentences from a module to test a property or apply a transformation.

Following the last comment of #3523.

@Robertorosmaninho
Copy link
Collaborator Author

We need to find which subtypes of sentences need to implement the ordering like we already have for Rules and Productions.

We also need a way to order all sentences between the types. Ex: Order -> Production

Also, we would like to have a lazy val within this types sorted like in sortedProdutions

@radumereuta
Copy link
Contributor

Unit tests should help here.
We don't have tests like this anywhere else.

@radumereuta
Copy link
Contributor

This was reverted because it may have been the cause of the release failing.
Revisit with more testing.

@radumereuta radumereuta reopened this Sep 5, 2023
@radumereuta
Copy link
Contributor

radumereuta commented Sep 7, 2023

Try to investigate by comparing definition.kore from mac and linux.
The order in which we put axioms in the kore file will have an effect on the search results.
OSx and linux might have different versions of the C++ std library.

We're putting the search results in a standard unordered set.
We're supposed to sort the output in the pretty printer. Investigate why that's not working.
https://github.com/runtimeverification/llvm-backend/blob/master/lib/ast/AST.cpp#L897

Ask Freeman for access to a Mac machine.

@gtrepta
Copy link
Contributor

gtrepta commented Sep 13, 2023

This sortCollections method that Radu linked doesn't look like it gets called when doing search.

Search calls printConfigurations in runtime/util/ConfigurationPrinter.cpp, which loops through the search results with PrintConfigurationInternal, which doesn't use sortCollections.

sortCollections gets used by printKORE, used by printMatchResult, used by the k-rule-apply tool.

@gtrepta
Copy link
Contributor

gtrepta commented Sep 14, 2023

Had a deeper look, my above comment can be ignored.

In the error case, the bad output is coming from kprint, which does make use of sortCollections. I'll keep investigating.

rv-jenkins pushed a commit to runtimeverification/llvm-backend that referenced this issue Sep 19, 2023
For runtimeverification/k#3530

This fixes a couple of issues where the way kprint was sorting AC
symbols involved spurious whitespaces and a problematic ordering of
operations.
@gtrepta gtrepta linked a pull request Sep 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants