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

Proof Refactoring #671

Merged
merged 97 commits into from
Aug 20, 2024
Merged

Proof Refactoring #671

merged 97 commits into from
Aug 20, 2024

Conversation

maul-esel
Copy link
Contributor

@maul-esel maul-esel commented Aug 9, 2024

This PR refactors how ULTIMATE works with proof artifacts (for now, primarily Floyd-Hoare annotations). The point is:

  1. to make it easier to work with proofs, by making them first-class concepts (e.g. IFloydHoareAnnotation) rather than annotations in an Icfg. This allows e.g. considering the proofs of multiple CEGAR loops separately (a more elegant solution than the workaround used in Wip/lf/pea complement only #670).
  2. to make the handling of proofs more flexible, in preparation for supporting other kinds of proofs; most importantly, thread-modular proofs at many levels and Owicki-Gries proofs. These other kinds of proofs are e.g. needed for concurrency correctness witnesses.

I consider the PR more or less ready for review, if the currently running nightly tests don't show any more issues. The only change I still have planned from my side is to go through the .epf files and adapt them to the following change in the settings for TraceAbstraction:

The setting Compute Hoare Annotation of negated interpolant automaton, abstraction and CFG has been removed. The existing setting Positions where we compute the Hoare Annotation has a possible value NONE (the default value) to disable Hoare computation completely.

However, I wanted to first ask if anyone objects to this or would propose a different settings structure, before I start going through all the settings files.

These changes allow computing Floyd/Hoare annotations for
product automata of concurrent programs.
BasicCegarLoop should not refer to Floyd/Hoare proofs, let NwaCegarLoop
handle this. Also, CEGAR loops refer directly to Hoare annotation states,
not IcfgLocations.
Do not check the setting again, the caller should supply the appropriate states.
Also define their semantics in the class itself,
rather than in some utility class.
@maul-esel maul-esel marked this pull request as ready for review August 12, 2024 18:37
Copy link
Member

@bahnwaerter bahnwaerter left a comment

Choose a reason for hiding this comment

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

The introduction of the new library for proofs looks great, at least for my knowledge on the subject. The new proof library has been created correctly. We just need to upgrade the Java version number in the Manifest.MF file later when we finally migrate to Java 21. In addition, @danieldietsch has to adjust the sonar coverage configuration in the Maven pom.xml under trunk/source/BA_MavenParentUltimate so that the code coverage for the library can be reported properly.

Removes the workaround introduced in 720a012, as proofs of different
CEGAR loops are now stored separately in the ICFG.

# Conflicts:
#	trunk/source/TraceAbstraction/src/de/uni_freiburg/informatik/ultimate/plugins/generator/traceabstraction/NwaCegarLoop.java
@maul-esel
Copy link
Contributor Author

maul-esel commented Aug 14, 2024

Thanks for the reviews. I'll wait for the nightly test run; if no further issues occur I will merge this tomorrow.

This is particularly useful if we create multiple proof objects
for the same program and different (partial) specifications, to
distinguish which proof objects relate to which specification.
Every procedure that exists in the IIcfg should have an exit location,
even if that location is unreachable.

This was not the case for the IIcfgs produced by the BlockEncodingV2 plugin.
This commit fixes this bug, and introduces an assert statement after block
encoding has finished to check if the produced IIcfg satisfies this invariant.

Moreover, we add two sanity checks regarding the computation of procedure contracts,
where the problem was discovered (the location of the ProcedureContractResult was null),
such that similar issues are caught earlier in the future.
@maul-esel
Copy link
Contributor Author

maul-esel commented Aug 18, 2024

Fixing the tests required some changes:

  • The precondition for our Floyd-Hoare annotations is not necessarily true; instead, it is a conjunction of (= g |old(g)|) for all modifiable global variables g of the initial location's procedure. This requires supporting different preconditions per initial location, in the case of multiple initial locations.
  • A bug in BlockEncodingV2 caused contract computation to fail, as some procedures did not have an exit location. I've fixed this, and added some checks to prevent similar bugs in the future.

While doing this, I also added a feature required e.g. in the context of requirements analysis: Each proof now also has an explicit description of the specification that it proves. This information is also added to InvariantResult and ProcedureContractResult (in the form of Check objects).

# Conflicts:
#	trunk/source/InvariantSynthesis/src/de/uni_freiburg/informatik/ultimate/plugins/generator/invariantsynthesis/InvariantSynthesisStarter.java
#	trunk/source/Library-ModelCheckerUtils/src/de/uni_freiburg/informatik/ultimate/lib/modelcheckerutils/smt/predicates/HoareAnnotation.java
#	trunk/source/Library-ModelCheckerUtils/src/de/uni_freiburg/informatik/ultimate/lib/modelcheckerutils/smt/predicates/PredicateFactory.java
#	trunk/source/TraceAbstraction/src/de/uni_freiburg/informatik/ultimate/plugins/generator/traceabstraction/HoareAnnotationWriter.java
Copy link
Member

@danieldietsch danieldietsch left a comment

Choose a reason for hiding this comment

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

Review so far, I would read on, but feel free to merge anyways,

# Conflicts:
#	releaseScripts/website-config/frontend/config.js
#	trunk/source/WebsiteStatic/config/config.dist.js
@maul-esel maul-esel merged commit df06d5d into dev Aug 20, 2024
2 checks passed
@maul-esel maul-esel deleted the wip/dk/proof-refactoring branch August 20, 2024 19:46
maul-esel added a commit that referenced this pull request Sep 16, 2024
…nted procedures

This was previously done in HoareAnnotationChecker [1], the predecessor of
IcfgFloydHoareValidityCheck previous to PR #671. The filter was missed in
the PR, and not discovered so far because of another bug in IcfgFloydHoareValidityCheck
(see fb77554).

[1] https://github.com/ultimate-pa/ultimate/blob/19fd058c3d438585a4f478206c978f85e13399ca/trunk/source/TraceAbstraction/src/de/uni_freiburg/informatik/ultimate/plugins/generator/traceabstraction/predicates/HoareAnnotationChecker.java#L141-L143
maul-esel added a commit that referenced this pull request Sep 18, 2024
Previously, the check did not actually check anything, because the
successor edges were calculated incorrectly and, in particular for
initial states, were always empty.

We also need to filter summary edges for implemented procedures as
they are not expected to be inductive. This was previously done in
HoareAnnotationChecker [1] previous to PR #671.

[1] https://github.com/ultimate-pa/ultimate/blob/19fd058c3d438585a4f478206c978f85e13399ca/trunk/source/TraceAbstraction/src/de/uni_freiburg/informatik/ultimate/plugins/generator/traceabstraction/predicates/HoareAnnotationChecker.java#L141-L143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants