-
Notifications
You must be signed in to change notification settings - Fork 41
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
Simplify implementation of YAML witnesses #668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your changes look great. Especially, the documentation comments increase code quality.
If omitting the access modifier is intentional, then I have nothing more to complain about.
...ate/plugins/generator/cacsl2boogietranslator/witness/GraphMLExtractedCorrectnessWitness.java
Outdated
Show resolved
Hide resolved
...timate/plugins/generator/cacsl2boogietranslator/witness/YamlExtractedCorrectnessWitness.java
Outdated
Show resolved
Hide resolved
location: | ||
file_name: contract.c | ||
file_hash: UNUSED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅
trunk/examples/witness-checking/regression/correctness/contract.c-witness.yml
Show resolved
Hide resolved
...ate/plugins/generator/cacsl2boogietranslator/witness/GraphMLCorrectnessWitnessExtractor.java
Show resolved
Hide resolved
...e/WitnessParser/src/de/uni_freiburg/informatik/ultimate/witnessparser/YamlWitnessParser.java
Show resolved
Hide resolved
...rc/de/uni_freiburg/informatik/ultimate/witnessprinter/preferences/PreferenceInitializer.java
Show resolved
Hide resolved
...de/uni_freiburg/informatik/ultimate/witnessprinter/yaml/YamlCorrectnessWitnessGenerator.java
Show resolved
Hide resolved
...ssPrinter/src/de/uni_freiburg/informatik/ultimate/witnessprinter/yaml/YamlWitnessWriter.java
Show resolved
Hide resolved
...Printer/src/de/uni_freiburg/informatik/ultimate/witnessprinter/yaml/YamlWitnessWriterV0.java
Show resolved
Hide resolved
71b46da
to
a136772
Compare
a136772
to
ce97273
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Thanks for all the work on improving this stuff :)
...tik/ultimate/plugins/generator/cacsl2boogietranslator/witness/ExtractedFunctionContract.java
Outdated
Show resolved
Hide resolved
...ate/plugins/generator/cacsl2boogietranslator/witness/GraphMLCorrectnessWitnessExtractor.java
Outdated
Show resolved
Hide resolved
...timate/plugins/generator/cacsl2boogietranslator/witness/YamlCorrectnessWitnessExtractor.java
Outdated
Show resolved
Hide resolved
ce97273
to
1a6cfd7
Compare
- function_contracts are contained in the invariant_set - the format for location_invariant and loop_invariant remains unchanged - since the format is now downwards compatible, the version number changes from 3.0 to 2.1 - see https://gitlab.com/sosy-lab/benchmarking/sv-witnesses/-/tree/2.1-function-contracts-dev for the format for function contracts
We always generate the same witness independent from the format version. Therefore WitnessSetEntry was removed and we have different writers instead. The toMap method was removed from WitnessEntry, since it was specific to format version 0.1. Only some common classes for the different format versions still provide a toMap method.
- only parse the entries from the YAML witness that are necessary for the validation - produce the other entries only in YamlWitnessWriter without storing them in the witness object itself - remove Invariant, Metadata, Producer, Task and produce nested maps directly in MetadataProvider and YamlWitnessWriter
This label is only required for GraphML. Instead there is now an interface IExtractedCorrectnessWitness with two implementations, one for GraphML and one for YAML, and only the GraphML implementation uses the label internally (using the internal class LabeledInvariant). Therefore it is no more required to parse the UUID from the YAML witness.
This should be done by witness linter in SV-COMP
1a6cfd7
to
dd23793
Compare
This PR attempts to simplify the implementation for YAML witnesses. The format has completely changed just before SV-COMP 2024 and thus the previous implementation for YAML witnesses was just an ad-hoc adaptation to the changed format.
invariant_set
(as in version 2.0), therefore the format for function contracts is downwards compatible and thus the format version was changed from 3.0 to 2.1WitnessEntry
had the methodstoMap
andtoSetEntry
for the string-conversion to format version 0.1 and 2.0 respectively. Instead of these methods, we have now two different writer-classes that decide which entries should be considered (function contracts should only be exported in version >= 2.1) and how the entries should be formatted in YAML.YamlWitnessParser
. Metadata are only needed for witness export, which are now produced using the introduced classMetadataProvider
MainDispatcher
that each entry is only instrumented once. This is however only specific to GraphML-witnesses. Therefore I added an interfaceIExtractedCorrectnessWitness
as an abstraction for the extracted witness entries from GraphML and YAML witnesses and only the GraphML-implementation uses these labels internally. For YAML witnesses we can already ensure that each entry is only instrumented once during extraction.After this PR is merged, #653 needs to be reworked.